[rspec-users] Rspec, Mocha Expectations Not Met Bug?

Sam Woodard lists at ruby-forum.com
Tue Dec 8 02:17:44 EST 2009


Code and tests at,

http://gist.github.com/251480

I have debugged this code and both destroy and email! are being called!
However, rspec/mocha says that the two expectations at the bottom of
these tests are not met: both tests fail.

Any help would be greatly appreciated.

Thanks you in advance,
Sam


1)
Mocha::ExpectationError in 'ContactImport email should destroy the ear
if the user is already a vbn member'
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked:
#<EmailedAssociationRequest:0x10685e088>.destroy(any_parameters)
...
./spec/models/contact_import_spec.rb:110:

2)
Mocha::ExpectationError in 'ContactImport email should email the ear if
the user is not already a vbn member'
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked:
#<EmailedAssociationRequest:0x1065fb700>.email!(any_parameters)
./spec/models/contact_import_spec.rb:120:

Finished in 1.967623 seconds

16 examples, 2 failures
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list