File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,6 +92,20 @@ class AbilitiesControllerTest < ActionController::TestCase
9292 end
9393 end
9494
95+ test ':update should prevent invalid updates' do
96+ ability = abilities ( :everyone )
97+ user = users ( :global_admin )
98+
99+ old_name = ability . name
100+
101+ sign_in user
102+ try_update_ability ( ability , description : 'valid' , name : '' )
103+ assert_response ( :bad_request )
104+
105+ ability . reload
106+ assert_equal ability . name , old_name
107+ end
108+
95109 test ':update should allow global mods & admins to network push' do
96110 ability = abilities ( :everyone )
97111
@@ -100,6 +114,7 @@ class AbilitiesControllerTest < ActionController::TestCase
100114
101115 sign_in user
102116 try_update_ability ( ability , description : description , network_push : true )
117+ assert_redirected_to ability_url ( id : ability . internal_id )
103118
104119 network_abilities = Ability . unscoped . where ( internal_id : ability . internal_id )
105120 assert network_abilities . any?
You can’t perform that action at this time.
0 commit comments