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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 00:09:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 00:09:22 +0300
commit27d314277bfe7fffec215efa9b1833a23bb82940 (patch)
tree898c606409718e70579beea62174624f84e28629 /spec/migrations
parent6b9d3a4e8351e662c4586b24bb152de78ae9e3bf (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations')
-rw-r--r--spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb
new file mode 100644
index 00000000000..fb8213a6bd6
--- /dev/null
+++ b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require Rails.root.join('db', 'migrate', '20200122161638_add_deploy_token_type_to_deploy_tokens.rb')
+
+describe AddDeployTokenTypeToDeployTokens, :migration do
+ let(:deploy_tokens) { table(:deploy_tokens) }
+ let(:deploy_token) do
+ deploy_tokens.create(name: 'token_test',
+ username: 'gitlab+deploy-token-1',
+ token_encrypted: 'dr8rPXwM+Mbs2p3Bg1+gpnXqrnH/wu6vaHdcc7A3isPR67WB',
+ read_repository: true,
+ expires_at: Time.now + 1.year)
+ end
+
+ it 'updates the deploy_token_type column to 2' do
+ expect(deploy_token).not_to respond_to(:deploy_token_type)
+
+ migrate!
+
+ deploy_token.reload
+ expect(deploy_token.deploy_token_type).to eq(2)
+ end
+end