Skip to content

Instantly share code, notes, and snippets.

@fukajun
Created December 13, 2012 14:03
Show Gist options
  • Select an option

  • Save fukajun/4276573 to your computer and use it in GitHub Desktop.

Select an option

Save fukajun/4276573 to your computer and use it in GitHub Desktop.
Rspec sample
describe "DELETE destroy" do
let!(:card) { Card.create! valid_attributes }
before do
expect {
delete :destroy, {:id => card.to_param}
}.should change(Card, :count).by(-1)
end
it { response.should redirect_to(cards_url) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment