debian-mirror-gitlab/spec/migrations/20221219122320_copy_clickhouse_connection_string_to_encrypted_var_spec.rb
2023-04-23 21:23:45 +05:30

20 lines
708 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe CopyClickhouseConnectionStringToEncryptedVar, feature_category: :product_analytics do
let!(:migration) { described_class.new }
let(:setting) { table(:application_settings).create!(clickhouse_connection_string: 'https://example.com/test') }
it 'copies the clickhouse_connection_string to the encrypted column' do
expect(setting.clickhouse_connection_string).to eq('https://example.com/test')
migrate!
setting.reload
expect(setting.clickhouse_connection_string).to eq('https://example.com/test')
expect(setting.encrypted_product_analytics_clickhouse_connection_string).not_to be_nil
end
end