summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 09:07:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 09:07:54 +0000
commit87ef501eacd66d7166183d20d84e33de022f7002 (patch)
treefa4e0f41e00a4b6aeb035530be4b5473f51b7a3d /spec/models/user_spec.rb
parentf321e51f46bcb628c3e96a44b5ebf3bb1c4033ab (diff)
downloadgitlab-ce-87ef501eacd66d7166183d20d84e33de022f7002.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 68cf41ce8a4..b8abe698639 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -29,6 +29,7 @@ describe User, :do_not_mock_admin_mode do
it { is_expected.to have_one(:namespace) }
it { is_expected.to have_one(:status) }
it { is_expected.to have_one(:max_access_level_membership) }
+ it { is_expected.to have_one(:user_detail) }
it { is_expected.to have_many(:snippets).dependent(:destroy) }
it { is_expected.to have_many(:members) }
it { is_expected.to have_many(:project_members) }
@@ -4318,4 +4319,19 @@ describe User, :do_not_mock_admin_mode do
expect(user.hook_attrs).to eq(user_attributes)
end
end
+
+ describe 'user detail' do
+ context 'when user is initialized' do
+ let(:user) { build(:user) }
+
+ it { expect(user.user_detail).to be_present }
+ it { expect(user.user_detail).not_to be_persisted }
+ end
+
+ context 'when user detail exists' do
+ let(:user) { create(:user, job_title: 'Engineer') }
+
+ it { expect(user.user_detail).to be_persisted }
+ end
+ end
end