Commit ad0e25bf authored by Markus Koller's avatar Markus Koller

Merge branch 'jl-fix-gitlab-employee-tests' into 'master'

Fix inaccurate gitlab_employee? tests

See merge request gitlab-org/gitlab!42915
parents a920b02c 11d3b147
......@@ -1256,26 +1256,28 @@ RSpec.describe User do
context 'based on user type' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
gitlab_group.add_user(user, Gitlab::Access::DEVELOPER)
end
context 'when user is a bot' do
let(:user) { build(:user, user_type: :alert_bot) }
let(:user) { create(:user, user_type: :alert_bot) }
it { is_expected.to be false }
end
context 'when user is ghost' do
let(:user) { build(:user, :ghost) }
let(:user) { create(:user, :ghost) }
it { is_expected.to be false }
end
end
context 'when `:gitlab_employee_badge` feature flag is disabled' do
let(:user) { build(:user) }
let(:user) { create(:user) }
before do
allow(Gitlab).to receive(:com?).and_return(true)
stub_feature_flags(gitlab_employee_badge: false)
gitlab_group.add_user(user, Gitlab::Access::DEVELOPER)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment