summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-20 18:43:11 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-20 18:43:11 -0500
commit4474eab4f6a17861a6ed494034bc68acb0724e3c (patch)
tree6a7e5b671a2d6bcd1b6c4c0f9328013070d99456 /spec/services
parentec86644545c1c2567dfaacb6d53d150a5dfa28d6 (diff)
downloadgitlab-ce-4474eab4f6a17861a6ed494034bc68acb0724e3c.tar.gz
Fix container deletion permission issue
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 6c9f56a4fba..73b8c3f048f 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -10,7 +10,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
subject { described_class.new(current_project, current_user, current_params).execute }
before do
- stub_container_registry_config(enabled: true, issuer: 'rspec', key: nil)
+ allow(Gitlab.config.registry).to receive_messages(enabled: true, issuer: 'rspec', key: nil)
allow_any_instance_of(JSONWebToken::RSAToken).to receive(:key).and_return(rsa_key)
end
@@ -60,6 +60,17 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
it { is_expected.to_not include(:token) }
end
+ describe '#full_access_token' do
+ let(:project) { create(:empty_project) }
+ let(:token) { described_class.full_access_token(project.path_with_namespace) }
+
+ subject { { token: token } }
+
+ it_behaves_like 'a accessible' do
+ let(:actions) { ['*'] }
+ end
+ end
+
context 'user authorization' do
let(:project) { create(:project) }
let(:current_user) { create(:user) }