Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/profiles/user_edit_profile_spec.rb')
-rw-r--r--spec/features/profiles/user_edit_profile_spec.rb28
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'))