diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-28 18:05:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-28 18:05:58 +0300 |
commit | a77db6bc47d8cdd9edae2ec22f640821d0794404 (patch) | |
tree | 15861a5f1ec29e07c2012102e463402bb7dc8c2d /spec/features/profiles | |
parent | 6cf6996f183bdff46e73431c07bfb723066a8222 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/user_edit_profile_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 0905ab0aef8..23f660d111a 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -66,6 +66,34 @@ describe 'User edit profile' do end end + describe 'when I change my role' do + context 'experiment enabled' do + before do + stub_experiment_for_user(signup_flow: true) + visit(profile_path) + end + + it 'changes my role' do + expect(page).to have_content 'Role' + select 'Data Analyst', from: 'user_role' + submit_settings + user.reload + expect(user.role).to eq 'data_analyst' + end + end + + context 'experiment disabled' do + before do + stub_experiment_for_user(signup_flow: false) + visit(profile_path) + end + + it 'does not show the role picker' do + expect(page).not_to have_content 'Role' + end + end + end + context 'user avatar' do before do attach_file(:user_avatar, Rails.root.join('spec', 'fixtures', 'banana_sample.gif')) |