From ba32953c0e171d1de6c9474fcdf293de754c1e42 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 19 Oct 2015 20:14:20 +0200 Subject: [PATCH] Adds test for erasing accounts --- spec/features/account_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index e0249072c..029864ec9 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -81,4 +81,20 @@ feature 'Account' do expect(page).to have_content error_message end + + scenario 'Erasing account' do + visit account_path + + click_link 'Erase my account' + + fill_in 'user_erase_reason', with: 'a test' + + click_button 'Erase my account' + + expect(page).to have_content "Your account has been successfully cancelled" + + login_through_form_as(@user) + + expect(page).to have_content "Invalid email or password" + end end