2020-01-29 21:09:22 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
require Rails.root.join('db', 'migrate', '20200122161638_add_deploy_token_type_to_deploy_tokens.rb')
|
|
|
|
|
2020-06-24 18:09:03 +00:00
|
|
|
RSpec.describe AddDeployTokenTypeToDeployTokens do
|
2020-01-29 21:09:22 +00:00
|
|
|
let(:deploy_tokens) { table(:deploy_tokens) }
|
|
|
|
let(:deploy_token) do
|
2020-12-10 21:10:15 +00:00
|
|
|
deploy_tokens.create!(name: 'token_test',
|
2020-01-29 21:09:22 +00:00
|
|
|
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
|