summaryrefslogtreecommitdiff
path: root/spec/policies/base_policy_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:50 +0000
commitca05512007cea51e05d3431b2c8bd7228c754370 (patch)
tree5202d429acd68c071445aff9e352379173ec9c0b /spec/policies/base_policy_spec.rb
parent6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (diff)
downloadgitlab-ce-ca05512007cea51e05d3431b2c8bd7228c754370.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies/base_policy_spec.rb')
-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 ae5af9e0f29..81aee4cfcac 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) { build_stubbed(:user) }
- let(:user) { build_stubbed(:user) }
+ let(:current_user) { create(:user) }
+ let(:user) { create(: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_stubbed(:admin) }
+ let(:current_user) { build(: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) { build_stubbed(:user) }
+ let(:current_user) { create(: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_stubbed(:admin) }
+ let(:current_user) { build(:admin) }
it 'allowed when in admin mode' do
enable_admin_mode!(current_user)