diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-15 13:49:11 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-15 13:49:11 +0200 |
commit | 9d1ccd2ad3af37139649100476b568d219343a57 (patch) | |
tree | 4475c8f777e25a3a7708ed7012f190b844fdaa7c /spec/services/auth | |
parent | 50076ab974348e74514bb4f19169351f08e11636 (diff) | |
download | gitlab-ce-9d1ccd2ad3af37139649100476b568d219343a57.tar.gz |
Fix existing authorization specs
Diffstat (limited to 'spec/services/auth')
-rw-r--r-- | spec/services/auth/container_registry_authentication_service_spec.rb | 14 |
1 files changed, 13 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 7cc71f706ce..c82deb7d423 100644 --- a/spec/services/auth/container_registry_authentication_service_spec.rb +++ b/spec/services/auth/container_registry_authentication_service_spec.rb @@ -6,8 +6,14 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do let(:current_params) { {} } let(:rsa_key) { OpenSSL::PKey::RSA.generate(512) } let(:payload) { JWT.decode(subject[:token], rsa_key).first } + let(:capabilities) do + [ + :read_container_image, + :create_container_image + ] + end - subject { described_class.new(current_project, current_user, current_params).execute } + subject { described_class.new(current_project, current_user, current_params).execute(capabilities: capabilities) } before do allow(Gitlab.config.registry).to receive_messages(enabled: true, issuer: 'rspec', key: nil) @@ -42,6 +48,12 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do 'actions' => actions, }] end + let(:capabilities) do + [ + :build_read_container_image, + :build_create_container_image + ] + end it_behaves_like 'a valid token' it { expect(payload).to include('access' => access) } |