Re: [rspec-users] RSpec stub question

2011-05-17 Thread Justin Ko
On Sat, May 14, 2011 at 12:13 AM, arunsark wrote: > Hi > > I am using Mongoid. In Mongoid while saving a record we typically give > like in the controller > @post.safely.save > For a model class Post > > I am writing rspecs for my controller and want to mock the model. So > what I am doing is > >

[rspec-users] RSpec stub question

2011-05-17 Thread arunsark
Hi I am using Mongoid. In Mongoid while saving a record we typically give like in the controller @post.safely.save For a model class Post I am writing rspecs for my controller and want to mock the model. So what I am doing is let(:post) { mock_model(Post).as_null_object } before(:each) do Pos