diff options
| author | mo khan <mo@mokhan.ca> | 2014-08-06 17:12:09 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-08-06 17:12:09 -0700 |
| commit | 5e0a8ccb6089d29a41cf47dc9b362362fe478808 (patch) | |
| tree | 195cb6da9c8bfc8b05b221d10ea3b00b70912bfb /spec/controllers | |
| parent | 984c3f67ef6e0460b1cc39460ceceefc09a39aa2 (diff) | |
create action to logout.
Diffstat (limited to 'spec/controllers')
| -rw-r--r-- | spec/controllers/sessions_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index aafd5a0c..d92ad989 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -42,4 +42,19 @@ describe SessionsController do end end end + + describe "#destroy" do + before :each do + request.cookies[:cookie_monster] = SecureRandom.uuid + delete :destroy, id: "me" + end + + it "removes the cookie" do + expect(cookies[:cookie_monster]).to be_nil + end + + it "redirects to the homepage" do + expect(response).to redirect_to(root_path) + end + end end |
