summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 18:09:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 18:09:06 +0000
commitb042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d (patch)
treede31671ab7c6ca8c2a3721cbabd1f2a42b3d0194 /spec/policies
parenteabf8fd774fef6a54903e5141138f47bdafeb331 (diff)
downloadgitlab-ce-b042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/base_policy_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/policies/base_policy_spec.rb b/spec/policies/base_policy_spec.rb
index 81aee4cfcac..ae5af9e0f29 100644
--- a/spec/policies/base_policy_spec.rb
+++ b/spec/policies/base_policy_spec.rb
@@ -23,8 +23,8 @@ describe BasePolicy, :do_not_mock_admin_mode do
end
describe 'read cross project' do
- let(:current_user) { create(:user) }
- let(:user) { create(:user) }
+ let(:current_user) { build_stubbed(:user) }
+ let(:user) { build_stubbed(:user) }
subject { described_class.new(current_user, [user]) }
@@ -38,7 +38,7 @@ describe BasePolicy, :do_not_mock_admin_mode do
it { is_expected.not_to be_allowed(:read_cross_project) }
context 'for admins' do
- let(:current_user) { build(:admin) }
+ let(:current_user) { build_stubbed(:admin) }
subject { described_class.new(current_user, nil) }
@@ -56,14 +56,14 @@ describe BasePolicy, :do_not_mock_admin_mode do
end
describe 'full private access' do
- let(:current_user) { create(:user) }
+ let(:current_user) { build_stubbed(:user) }
subject { described_class.new(current_user, nil) }
it { is_expected.not_to be_allowed(:read_all_resources) }
context 'for admins' do
- let(:current_user) { build(:admin) }
+ let(:current_user) { build_stubbed(:admin) }
it 'allowed when in admin mode' do
enable_admin_mode!(current_user)