[rspec-users] mocking errors

David Smalley david.smalley.lists at googlemail.com
Sun Jun 24 09:22:00 EDT 2007

What is the correct way to mock out the errors on a Rails model?

I'm assuming i need to say

@mock_thing = mock_model(Thing)
@mock_thing_errors = mock("errors")
@mock_thing_errors.should_receive(:full_messages).and_return("An error")

Just wanted to check the best practice on this kind of thing and how  
other people handle it.



More information about the rspec-users mailing list