summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-04-05 22:02:13 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-06 21:20:17 -0500
commitc4f56a88029c1fe73bf6efb062b5f77a65282fed (patch)
tree890a869e8ce06a5438b38c8e9dca9529362cc2f4 /spec/services
parenta475411f4380ef4d0260940206e2553da3b2f3ee (diff)
downloadgitlab-ce-c4f56a88029c1fe73bf6efb062b5f77a65282fed.tar.gz
Increase test suite around deploy tokens behavior
Also, fixes broken specs
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb1
-rw-r--r--spec/services/deploy_tokens/create_service_spec.rb28
2 files changed, 0 insertions, 29 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 0949ec24c50..290eeae828e 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -558,7 +558,6 @@ describe Auth::ContainerRegistryAuthenticationService do
let(:project) { create(:project, :public) }
context 'when pulling and pushing' do
- let(:current_user) { create(:deploy_token, projects: [project]) }
let(:current_params) do
{ scope: "repository:#{project.full_path}:pull,push" }
end
diff --git a/spec/services/deploy_tokens/create_service_spec.rb b/spec/services/deploy_tokens/create_service_spec.rb
index 4830f17faa8..2a308a9bf8c 100644
--- a/spec/services/deploy_tokens/create_service_spec.rb
+++ b/spec/services/deploy_tokens/create_service_spec.rb
@@ -20,20 +20,6 @@ describe DeployTokens::CreateService, :clean_gitlab_redis_shared_state do
it 'returns a DeployToken' do
expect(subject).to be_an_instance_of DeployToken
end
-
- it 'should store the token on redis' do
- redis_key = DeployToken.redis_shared_state_key(user.id)
- subject
-
- expect(Gitlab::Redis::SharedState.with { |redis| redis.get(redis_key) }).not_to be_nil
- end
-
- it 'should not store deploy token attributes on redis' do
- redis_key = DeployToken.redis_shared_state_key(user.id) + ":attributes"
- subject
-
- expect(Gitlab::Redis::SharedState.with { |redis| redis.get(redis_key) }).to be_nil
- end
end
context 'when the deploy token is invalid' do
@@ -46,20 +32,6 @@ describe DeployTokens::CreateService, :clean_gitlab_redis_shared_state do
it 'should not create a new ProjectDeployToken' do
expect { subject }.not_to change { ProjectDeployToken.count }
end
-
- it 'should not store the token on redis' do
- redis_key = DeployToken.redis_shared_state_key(user.id)
- subject
-
- expect(Gitlab::Redis::SharedState.with { |redis| redis.get(redis_key) }).to be_nil
- end
-
- it 'should store deploy token attributes on redis' do
- redis_key = DeployToken.redis_shared_state_key(user.id) + ":attributes"
- subject
-
- expect(Gitlab::Redis::SharedState.with { |redis| redis.get(redis_key) }).not_to be_nil
- end
end
end
end