Commit e18c287a authored by Rémy Coutable's avatar Rémy Coutable

[EE] Reduce the diff with CE in spec/policies/namespace_policy_spec.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5f47dabf
# frozen_string_literal: true
require 'spec_helper'
describe NamespacePolicy do
let(:owner) { create(:user) }
let(:namespace) { create(:namespace, owner: owner) }
let(:owner_permissions) { [:create_projects, :admin_namespace, :read_namespace] }
subject { described_class.new(current_user, namespace) }
context 'auditor' do
let(:current_user) { create(:user, :auditor) }
context 'owner' do
let(:namespace) { create(:namespace, owner: current_user) }
it { is_expected.to be_allowed(*owner_permissions) }
end
context 'non-owner' do
it { is_expected.to be_disallowed(*owner_permissions) }
end
end
end
......@@ -3,7 +3,6 @@ require 'spec_helper'
describe NamespacePolicy do
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:auditor) { create(:user, :auditor) }
let(:admin) { create(:admin) }
let(:namespace) { create(:namespace, owner: owner) }
......@@ -35,20 +34,6 @@ describe NamespacePolicy do
end
end
context 'auditor' do
let(:current_user) { auditor }
context 'owner' do
let(:namespace) { create(:namespace, owner: auditor) }
it { is_expected.to be_allowed(*owner_permissions) }
end
context 'non-owner' do
it { is_expected.to be_disallowed(*owner_permissions) }
end
end
context 'admin' do
let(:current_user) { admin }
......
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