diff options
Diffstat (limited to 'spec/models/concerns/protected_ref_access_spec.rb')
-rw-r--r-- | spec/models/concerns/protected_ref_access_spec.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/spec/models/concerns/protected_ref_access_spec.rb b/spec/models/concerns/protected_ref_access_spec.rb deleted file mode 100644 index 750a5eba303..00000000000 --- a/spec/models/concerns/protected_ref_access_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe ProtectedRefAccess do - include ExternalAuthorizationServiceHelpers - - subject(:protected_ref_access) do - create(:protected_branch, :maintainers_can_push).push_access_levels.first - end - - let(:project) { protected_ref_access.project } - - describe '#check_access' do - it 'is always true for admins' do - admin = create(:admin) - - expect(protected_ref_access.check_access(admin)).to be_truthy - end - - it 'is true for maintainers' do - maintainer = create(:user) - project.add_maintainer(maintainer) - - expect(protected_ref_access.check_access(maintainer)).to be_truthy - end - - it 'is for developers of the project' do - developer = create(:user) - project.add_developer(developer) - - expect(protected_ref_access.check_access(developer)).to be_falsy - end - - context 'external authorization' do - it 'is false if external authorization denies access' do - maintainer = create(:user) - project.add_maintainer(maintainer) - external_service_deny_access(maintainer, project) - - expect(protected_ref_access.check_access(maintainer)).to be_falsey - end - end - end -end |