1 require "application_system_test_case"
3 class AccountDeletionTest < ApplicationSystemTestCase
5 @user = create(:user, :display_name => "test user")
9 test "the status is deleted and the personal data removed" do
10 visit edit_account_path
12 click_link "Delete Account..."
14 click_link "Delete Account"
17 assert_current_path root_path
19 assert_equal "deleted", @user.status
20 assert_equal "user_#{@user.id}", @user.display_name
23 test "the user is signed out after deletion" do
24 visit edit_account_path
26 click_link "Delete Account..."
28 click_link "Delete Account"
31 assert_content "Log In"
34 test "the user is shown a confirmation flash message" do
35 visit edit_account_path
37 click_link "Delete Account..."
39 click_link "Delete Account"
42 assert_content "Account Deleted"