Skip to content

Commit 271fc2c

Browse files
committed
Fix Failing tests
1 parent 384f783 commit 271fc2c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/custom_message_settings_controller_test.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def test_edit
2424
def test_edit_except_admin_user
2525
@request.session[:user_id] = 2
2626
get :edit
27-
assert_redirected_to (/#{signin_path}/)
27+
assert_response 403
28+
assert_select 'p#errorExplanation', text: 'You are not authorized to access this page.'
2829
end
2930

3031
def test_update_with_custom_messages
@@ -56,7 +57,8 @@ def test_update_except_admin_user
5657
@request.session[:user_id] = 2
5758
get :update, params: { settings: {'custom_messages'=>{'label_home' => 'Home3'}}, lang: 'en', tab: 'normal' }
5859

59-
assert_redirected_to (/#{signin_path}/)
60+
assert_response 403
61+
assert_select 'p#errorExplanation', text: 'You are not authorized to access this page.'
6062
end
6163

6264
def test_toggle_enabled
@@ -71,6 +73,7 @@ def test_toggle_enabled_except_admin_user
7173
@request.session[:user_id] = 2
7274
patch :toggle_enabled
7375

74-
assert_redirected_to (/#{signin_path}/)
76+
assert_response 403
77+
assert_select 'p#errorExplanation', text: 'You are not authorized to access this page.'
7578
end
7679
end

0 commit comments

Comments
 (0)