test/integration/authenticatable_test.rb in devise-3.2.4 vs test/integration/authenticatable_test.rb in devise-3.3.0

- old
+ new

@@ -116,17 +116,17 @@ get root_path assert_contain 'Signed out successfully' assert_not warden.authenticated?(:admin) end - test 'unauthenticated admin does not set message on sign out' do + test 'unauthenticated admin set message on sign out' do get destroy_admin_session_path assert_response :redirect assert_redirected_to root_path get root_path - assert_not_contain 'Signed out successfully' + assert_contain 'Signed out successfully' end test 'scope uses custom failure app' do put "/en/accounts/management" assert_equal "Oops, not found", response.body @@ -446,11 +446,11 @@ end end test 'uses the custom controller with the custom controller view' do get '/admin_area/sign_in' - assert_contain 'Sign in' + assert_contain 'Log in' assert_contain 'Welcome to "admins/sessions" controller!' assert_contain 'Welcome to "sessions/new" view!' end test 'render 404 on roles without routes' do @@ -707,7 +707,23 @@ sign_in_as_admin get new_user_session_path(format: :html) assert_redirected_to '/' get new_admin_session_path(format: :html) assert_redirected_to '/admin_area/home' + end +end + +class DoubleSignOutRedirectTest < ActionDispatch::IntegrationTest + test 'sign out after already having signed out redirects to sign in' do + sign_in_as_user + + post destroy_sign_out_via_delete_or_post_session_path + + get root_path + assert_contain 'Signed out successfully.' + + post destroy_sign_out_via_delete_or_post_session_path + + get root_path + assert_contain 'Signed out successfully.' end end