Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-16 10:59:10 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-16 12:12:21 +0300
commite941365f3be88cebd57e9b08ba8702c1b688cb94 (patch)
tree903b454248eb3ba230eabfb2c5427a11161e4c5c /spec/services/auth
parentac6412d0766fbc090a3aa8272cfd4cc2d9a26c16 (diff)
Rename capabilities to authentication_abilities
Diffstat (limited to 'spec/services/auth')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 2d39bd61b8f..c64df4979b0 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -6,14 +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
+ let(:authentication_abilities) do
[
:read_container_image,
:create_container_image
]
end
- subject { described_class.new(current_project, current_user, current_params).execute(capabilities: capabilities) }
+ subject { described_class.new(current_project, current_user, current_params).execute(authentication_abilities: authentication_abilities) }
before do
allow(Gitlab.config.registry).to receive_messages(enabled: true, issuer: 'rspec', key: nil)
@@ -198,7 +198,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
context 'build authorized as user' do
let(:current_project) { create(:empty_project) }
let(:current_user) { create(:user) }
- let(:capabilities) do
+ let(:authentication_abilities) do
[
:build_read_container_image,
:build_create_container_image
@@ -255,7 +255,17 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
context 'when you are admin' do
let(:current_user) { create(:admin) }
- it_behaves_like 'pullable for being team member'
+ context 'when you are not member' do
+ it_behaves_like 'an inaccessible'
+ end
+
+ context 'when you are member' do
+ before do
+ project.team << [current_user, :developer]
+ end
+
+ it_behaves_like 'a pullable'
+ end
end
end
end