X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f75eb6fe9ef1e0a755c1a1810c5ca15ed58d9d08..01b84a810703041bc4a5011068214c92de0a5bec:/test/controllers/user_blocks_controller_test.rb?ds=sidebyside diff --git a/test/controllers/user_blocks_controller_test.rb b/test/controllers/user_blocks_controller_test.rb index d5db89615..3e2be801d 100644 --- a/test/controllers/user_blocks_controller_test.rb +++ b/test/controllers/user_blocks_controller_test.rb @@ -351,7 +351,14 @@ class UserBlocksControllerTest < ActionDispatch::IntegrationTest assert_select "input[type='submit'][value='Revoke!']", :count => 1 end - # Check that revoking a block works + # Check that revoking a block using GET should fail + get revoke_user_block_path(:id => active_block, :confirm => true) + assert_response :success + assert_template "revoke" + b = UserBlock.find(active_block.id) + assert b.ends_at - Time.now > 100 + + # Check that revoking a block works using POST post revoke_user_block_path(:id => active_block, :confirm => true) assert_redirected_to user_block_path(active_block) b = UserBlock.find(active_block.id)