From ca05512007cea51e05d3431b2c8bd7228c754370 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 4 Feb 2020 18:08:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/policies/base_policy_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/policies') 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) -- cgit v1.2.1