From 6c559995ab9d5e71dec084346341cac7602e663a Mon Sep 17 00:00:00 2001 From: SarvarKhalimov Date: Mon, 10 Jan 2022 22:50:44 +0500 Subject: [PATCH] Add test for user log_out user#destroy --- spec/controllers/spree/user_sessions_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/spree/user_sessions_controller_spec.rb b/spec/controllers/spree/user_sessions_controller_spec.rb index fcbca67cf3..8d85dfd55c 100644 --- a/spec/controllers/spree/user_sessions_controller_spec.rb +++ b/spec/controllers/spree/user_sessions_controller_spec.rb @@ -30,4 +30,13 @@ describe Spree::UserSessionsController, type: :controller do end end end + + describe "destroy" do + it "redirects to root with flash message" do + spree_post :destroy + + expect(response).to redirect_to root_path + expect(flash[:notice]).to eq "Signed out successfully." + end + end end