summaryrefslogtreecommitdiff
path: root/spec/models/deploy_token_spec.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-08-02 19:43:36 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-08-02 19:43:36 +0200
commita6268d302379258b1a2bf50f7db87b40e84ffe94 (patch)
tree2af5bd8ff3e095310a3745451ce7d1547d81f6e4 /spec/models/deploy_token_spec.rb
parent367e7520b08b1b731d5298fe700fc39f356017ce (diff)
downloadgitlab-ce-a6268d302379258b1a2bf50f7db87b40e84ffe94.tar.gz
Fix deploy tokens without `expire_at` crashes
Diffstat (limited to 'spec/models/deploy_token_spec.rb')
-rw-r--r--spec/models/deploy_token_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/deploy_token_spec.rb b/spec/models/deploy_token_spec.rb
index cd84a684fec..3435f93c999 100644
--- a/spec/models/deploy_token_spec.rb
+++ b/spec/models/deploy_token_spec.rb
@@ -74,6 +74,14 @@ describe DeployToken do
expect(deploy_token.active?).to be_falsy
end
end
+
+ context "when it hasn't been revoked and has no expiry" do
+ let(:deploy_token) { create(:deploy_token, expires_at: nil) }
+
+ it 'should return true' do
+ expect(deploy_token.active?).to be_truthy
+ end
+ end
end
describe '#username' do