X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/14936150ac8ab5cb4e8347b772b2c966f2add43f..642070f1e5dee82077676aa300ff47fbac11c506:/test/controllers/accounts_controller_test.rb diff --git a/test/controllers/accounts_controller_test.rb b/test/controllers/accounts_controller_test.rb index 7546c3797..131292f41 100644 --- a/test/controllers/accounts_controller_test.rb +++ b/test/controllers/accounts_controller_test.rb @@ -152,4 +152,23 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest # Make sure we have a button to "go public" assert_select "form.button_to[action='/user/go_public']", true end + + def test_destroy_allowed + user = create(:user) + session_for(user) + + delete account_path + assert_response :redirect + end + + def test_destroy_not_allowed + with_user_account_deletion_delay(24) do + user = create(:user) + create(:changeset, :user => user, :created_at => Time.now.utc) + session_for(user) + + delete account_path + assert_response :bad_request + end + end end