summaryrefslogtreecommitdiff
path: root/spec/features/profiles
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 12:09:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 12:09:12 +0000
commitcbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2 (patch)
treee4879b35d019d3bbba1689f3ac4c48b81bf7b451 /spec/features/profiles
parent3fd97b4bba24ca412112aad025a38a32c7a6cf8c (diff)
downloadgitlab-ce-cbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/profiles')
-rw-r--r--spec/features/profiles/user_edit_profile_spec.rb52
1 files changed, 44 insertions, 8 deletions
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb
index 9839b3d6c80..171dfb353f0 100644
--- a/spec/features/profiles/user_edit_profile_spec.rb
+++ b/spec/features/profiles/user_edit_profile_spec.rb
@@ -15,6 +15,11 @@ describe 'User edit profile' do
wait_for_requests if respond_to?(:wait_for_requests)
end
+ def visit_user
+ visit user_path(user)
+ wait_for_requests
+ end
+
it 'changes user profile' do
fill_in 'user_skype', with: 'testskype'
fill_in 'user_linkedin', with: 'testlinkedin'
@@ -22,8 +27,8 @@ describe 'User edit profile' do
fill_in 'user_website_url', with: 'testurl'
fill_in 'user_location', with: 'Ukraine'
fill_in 'user_bio', with: 'I <3 GitLab'
+ fill_in 'user_job_title', with: 'Frontend Engineer'
fill_in 'user_organization', with: 'GitLab'
- select 'Data Analyst', from: 'user_role'
submit_settings
expect(user.reload).to have_attributes(
@@ -32,8 +37,8 @@ describe 'User edit profile' do
twitter: 'testtwitter',
website_url: 'testurl',
bio: 'I <3 GitLab',
- organization: 'GitLab',
- role: 'data_analyst'
+ job_title: 'Frontend Engineer',
+ organization: 'GitLab'
)
expect(find('#user_location').value).to eq 'Ukraine'
@@ -94,11 +99,6 @@ describe 'User edit profile' do
end
context 'user status', :js do
- def visit_user
- visit user_path(user)
- wait_for_requests
- end
-
def select_emoji(emoji_name, is_modal = false)
emoji_menu_class = is_modal ? '.js-modal-status-emoji-menu' : '.js-status-emoji-menu'
toggle_button = find('.js-toggle-emoji-menu')
@@ -381,4 +381,40 @@ describe 'User edit profile' do
end
end
end
+
+ context 'work information', :js do
+ context 'when job title and organziation are entered' do
+ it "shows job title and organzation on user's profile" do
+ fill_in 'user_job_title', with: 'Frontend Engineer'
+ fill_in 'user_organization', with: 'GitLab - work info test'
+ submit_settings
+
+ visit_user
+
+ expect(page).to have_content('Frontend Engineer at GitLab - work info test')
+ end
+ end
+
+ context 'when only job title is entered' do
+ it "shows only job title on user's profile" do
+ fill_in 'user_job_title', with: 'Frontend Engineer - work info test'
+ submit_settings
+
+ visit_user
+
+ expect(page).to have_content('Frontend Engineer - work info test')
+ end
+ end
+
+ context 'when only organization is entered' do
+ it "shows only organization on user's profile" do
+ fill_in 'user_organization', with: 'GitLab - work info test'
+ submit_settings
+
+ visit_user
+
+ expect(page).to have_content('GitLab - work info test')
+ end
+ end
+ end
end