From 4cc5762e833961a5e21ee1ac716234735e265897 Mon Sep 17 00:00:00 2001 From: Benjamin Wols Date: Thu, 1 Dec 2016 19:30:52 +0100 Subject: [PATCH] Add test for deleting cookie on logout --- spec/features/two_factor_authenticatable_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/features/two_factor_authenticatable_spec.rb b/spec/features/two_factor_authenticatable_spec.rb index ebde2d8..d433d63 100644 --- a/spec/features/two_factor_authenticatable_spec.rb +++ b/spec/features/two_factor_authenticatable_spec.rb @@ -174,6 +174,18 @@ feature "User of two factor authentication" do visit dashboard_path expect(page).to have_content("Enter the code that was sent to you") end + + scenario 'Delete cookie when user logs out if enabled' do + user.class.delete_cookie_on_logout = true + + login_as user + logout + + login_as user + + visit dashboard_path + expect(page).to have_content("Enter the code that was sent to you") + end end it 'sets the warden session need_two_factor_authentication key to true' do