ruby on rails - RSpec Test Call to ActiveMailer model -
hey trying rspec test if action calls specific method in model have inherits activemailer have been having no luck. quick mockup have following scenario. model usernotifier:
class usernotifier < actionmailer::base def foobaz end end
controller password controller:
class passwordscontroller < applicationcontroller def foobar usernotifier.foobaz end
and spec:
describe "get 'foobar'" "should call usernotifier foobaz method" usernotifier.should_receive(:foobaz) :foobar end end
but end failure:
1) passwordscontroller 'foobar' should call usernotifier foobaz method failure/error: usernotifier.should_receive(:foobaz) (<usernotifier (class)>).foobaz(any args) expected: 1 time received: 0 times
can enlighten me why rspec not register usernotifier.foobaz method being called?
answered in comments ryan bigg. ended being before_filter causing method never run
Comments
Post a Comment