On 20.5.2008, at 14.26, Ashley Moran wrote:


On 20 May 2008, at 11:50, Doug Livesey wrote:

Obviously, the view calls for a number of attributes from the
@input_timesheet, but unless I explicitly define these in the mock_model
method, I get the following kind of error:


I'm puzzled, I thought you always had to stub methods on a mock from mock_model? I don't remember the default behaviour ever being to ignore unknown messages?

Sorry, guess this is not a helpful post, I just wanted to know how it behaves for you normally.

mock_model doesn't stub any methods automatically, and it doesn't matter whether you're in view, model or controller specs. If you need the attributes and don't want to specify anything by hand, stub_model might work for you. It basically creates a real AR object, with its db connections cut.

//jarkko



Ashley


--
http://www.patchspace.co.uk/
http://aviewfromafar.net/



_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to