diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-06 19:23:45 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-07 05:20:17 +0300 |
commit | 18a1569319af918fe3aff7564e344143d04d6aca (patch) | |
tree | 3e52875f9b67abbdf4f3dd6be7b7d8e05963a788 /spec/services/deploy_tokens | |
parent | 8c276580431a750a3141f2ec57690da844a75ac4 (diff) |
Handles default expires_at date directly into DeployToken model
Diffstat (limited to 'spec/services/deploy_tokens')
-rw-r--r-- | spec/services/deploy_tokens/create_service_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/services/deploy_tokens/create_service_spec.rb b/spec/services/deploy_tokens/create_service_spec.rb index 2a308a9bf8c..2e02b7a28b5 100644 --- a/spec/services/deploy_tokens/create_service_spec.rb +++ b/spec/services/deploy_tokens/create_service_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe DeployTokens::CreateService, :clean_gitlab_redis_shared_state do +describe DeployTokens::CreateService do let(:project) { create(:project) } let(:user) { create(:user) } let(:deploy_token_params) { attributes_for(:deploy_token) } @@ -22,6 +22,14 @@ describe DeployTokens::CreateService, :clean_gitlab_redis_shared_state do end end + context 'when expires at date is not passed' do + let(:deploy_token_params) { attributes_for(:deploy_token, expires_at: '') } + + it 'should set FOREVER date' do + expect(subject.expires_at).to eq(DeployToken::FOREVER) + end + end + context 'when the deploy token is invalid' do let(:deploy_token_params) { attributes_for(:deploy_token, read_repository: false, read_registry: false) } |