From a77db6bc47d8cdd9edae2ec22f640821d0794404 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 28 Oct 2019 15:05:58 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/features/profiles/user_edit_profile_spec.rb | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'spec/features/profiles') 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')) -- cgit v1.2.3