From 82f307ae61ae3067e8fa2f028d50d09698cef4b0 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 10 May 2023 10:41:43 +0100 Subject: [PATCH] Adds test case for logging out --- spec/system/admin/authentication_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/system/admin/authentication_spec.rb b/spec/system/admin/authentication_spec.rb index 8cf5fd8c11..d83e2a3f7d 100644 --- a/spec/system/admin/authentication_spec.rb +++ b/spec/system/admin/authentication_spec.rb @@ -26,4 +26,18 @@ describe "Authentication" do click_link "Account" expect(page).to have_current_path spree.account_path end + + context "logged in" do + before do + login_as user + visit root_path + end + + it "logs out" do + page.find("li", class: "user-menu").click + click_on "Logout" + expect(page).to have_content "Signed out successfully." + expect(page).to have_content "Login" + end + end end