Skip to content

Instantly share code, notes, and snippets.

@rhysforyou
Created November 28, 2011 11:44
Show Gist options
  • Select an option

  • Save rhysforyou/1400106 to your computer and use it in GitHub Desktop.

Select an option

Save rhysforyou/1400106 to your computer and use it in GitHub Desktop.
describe "PUT '/books/:id'" do
it "should update a Book's attributes" do
@book = FactoryGirl.create(:book)
new_attrs = {title: "New title", author: "New Author"}
put :update, :id => @book.id, :book => new_attrs
@book.reload
@book.title.should eq("New title")
@book.author.should eq("New Author")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment