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/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 6303fe8a5bb..849494e7cd4 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -4335,4 +4335,27 @@ describe User, :do_not_mock_admin_mode do
it { expect(user.user_detail).to be_persisted }
end
end
+
+ describe '#gitlab_employee?' do
+ using RSpec::Parameterized::TableSyntax
+
+ subject { user.gitlab_employee? }
+
+ where(:email, :is_com, :expected_result) do
+ 'test@gitlab.com' | true | true
+ 'test@example.com' | true | false
+ 'test@gitlab.com' | false | false
+ 'test@example.com' | false | false
+ end
+
+ with_them do
+ let(:user) { build(:user, email: email) }
+
+ before do
+ allow(Gitlab).to receive(:com?).and_return(is_com)
+ end
+
+ it { is_expected.to be expected_result }
+ end
+ end
end