pgp_key_email_addresses_spec.rb 784 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe PGPKeyEmailAddresses, db_strategy: :reset, type: :db_migration do
  4. before do
  5. add_column :pgp_keys, :uids, :string, limit: 3000, null: false, default: ''
  6. add_index :pgp_keys, [:uids], length: 255
  7. without_column :pgp_keys, column: :name
  8. without_column :pgp_keys, column: :email_addresses
  9. PGPKey.reset_column_information
  10. migrate
  11. end
  12. it 'adds `name` column' do
  13. expect(column_exists?(:pgp_keys, :name)).to be(true)
  14. end
  15. it 'adds `email_addresses` column' do
  16. expect(column_exists?(:pgp_keys, :email_addresses)).to be(true)
  17. end
  18. it 'removes `uids` column' do
  19. expect(column_exists?(:pgp_keys, :uids)).to be(false)
  20. end
  21. end