Skip to content

Instantly share code, notes, and snippets.

@aaronjensen
Created September 15, 2011 15:31
Show Gist options
  • Save aaronjensen/1219565 to your computer and use it in GitHub Desktop.
Save aaronjensen/1219565 to your computer and use it in GitHub Desktop.
testing cookie deletes in rails
describe MyController do
let(:cookies) { mock('cookies') }
context "when my page is visited" do
it "should delete my cookie" do
controller.stub!(:cookies).and_return(cookies)
cookies.should_receive(:delete).with(cookie, :domain => '.mydomain.com')
get "my_action"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment