diff options
author | Shah El-Rahman <selrahman@gitlab.com> | 2018-04-06 12:36:22 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-04-06 12:36:22 +0300 |
commit | 43ef375e084884ed4260ac9c9de8f601d5594c90 (patch) | |
tree | b5214f9deb9f389e5428f5c011b9c7cbfc55d506 /spec/features | |
parent | ca330f7ea30b368b928f5468a1f53264d74aa8aa (diff) |
Add confirmation modal to "Change username"
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/profile_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/profiles/account_spec.rb | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index 0848857ed1e..15dcb30cbdd 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -97,9 +97,13 @@ describe 'Profile account page', :js do end it 'changes my username' do - fill_in 'user_username', with: 'new-username' + fill_in 'username-change-input', with: 'new-username' - click_button('Update username') + page.find('[data-target="#username-change-confirmation-modal"]').click + + page.within('.modal') do + find('.js-modal-primary-action').click + end expect(page).to have_content('new-username') end diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index e8eb0d17ca4..215b658eb7b 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -feature 'Profile > Account' do +feature 'Profile > Account', :js do given(:user) { create(:user, username: 'foo') } before do @@ -59,6 +59,12 @@ end def update_username(new_username) allow(user.namespace).to receive(:move_dir) visit profile_account_path - fill_in 'user_username', with: new_username - click_button 'Update username' + + fill_in 'username-change-input', with: new_username + + page.find('[data-target="#username-change-confirmation-modal"]').click + + page.within('.modal') do + find('.js-modal-primary-action').click + end end |