Displaying 1 result from an estimated 1 matches for "4cfd148a".
Did you mean:
4cf348a
2011 May 14
1
RSpec stub question
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
Post.stub(:new).and_return(post)
end
it "creates new post"