Created
September 30, 2011 16:18
-
-
Save calebwoods/1254258 to your computer and use it in GitHub Desktop.
Failing PUT
This file contains hidden or 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 "with invalid params" do | |
it "assigns the snippet as @snippet" do | |
snippet = FactoryGirl.create(:snippet) | |
# Trigger the behavior that occurs when invalid params are submitted | |
Snippet.any_instance.stub(:save).and_return(false) | |
put :update, :id => snippet.id.to_s, :snippet => {} | |
assigns(:snippet).should eq(snippet) | |
end | |
it "re-renders the 'edit' template" do | |
snippet = FactoryGirl.create(:snippet) | |
# Trigger the behavior that occurs when invalid params are submitted | |
Snippet.any_instance.stub(:save).and_return(false) | |
put :update, :id => snippet.id.to_s, :snippet => {} | |
response.should render_template("edit") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment