Created
March 2, 2011 22:11
-
-
Save mikepack/851864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "POST create" do | |
describe "with valid params" do | |
it "assigns a newly created attending as @attending" do | |
Attending.stub(:new).with({'event_id' => 1}) { mock_attending(:save => true) } | |
post :create, :event_id => 1 | |
assigns(:attending).should be(mock_attending) | |
end | |
end | |
end | |
Produces: | |
Failure/Error: post :create, :event_id => 1 | |
<Attending(id: integer, user_id: integer, event_id: integer, created_at: datetime, updated_at: datetime) (class)> received :new with unexpected arguments | |
expected: ({"event_id"=>1}) | |
got: ({:event_id=>1}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment