describe MessagesController, “POST create” do
before(:each) do
@message = mock_model(Message, :save => nil)
Message.stub(:new).and_return(@message)
end
context “when the message fails to save” do
before(:each) do
@message.stub(:save).and_return(false)
end
it "assigns @message" do
post :create
assigns[:message].should == @message
end
What is the RSpec 2 equivalent for assigns[:message].should ==
@message in this context?
Failure/Error: assigns[:message].should == @message
expected: #<Message:0x819b4318 @name="Message_1005">,
got: nil (using ==)