diff options
Diffstat (limited to 'spec/features/profiles/account_spec.rb')
-rw-r--r-- | spec/features/profiles/account_spec.rb | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index c6db15065f2..620c2f60ba3 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Account', :js do +RSpec.describe 'Profile > Account', :js do let(:user) { create(:user, username: 'foo') } before do @@ -56,6 +56,37 @@ describe 'Profile > Account', :js do end end end + + describe 'Delete account' do + before do + create_list(:project, number_of_projects, namespace: user.namespace) + visit profile_account_path + end + + context 'when there are no personal projects' do + let(:number_of_projects) { 0 } + + it 'does not show personal projects removal message' do + expect(page).not_to have_content(/\d personal projects? will be removed and cannot be restored/) + end + end + + context 'when one personal project exists' do + let(:number_of_projects) { 1 } + + it 'does show personal project removal message' do + expect(page).to have_content('1 personal project will be removed and cannot be restored') + end + end + + context 'when more than one personal projects exists' do + let(:number_of_projects) { 3 } + + it 'shows pluralized personal project removal message' do + expect(page).to have_content('3 personal projects will be removed and cannot be restored') + end + end + end end def update_username(new_username) |