issue_3810_custom_date_attribute_no_default_spec.rb 748 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Issue3810CustomDateAttributeNoDefault, db_strategy: :reset_all, type: :db_migration do
  4. before :all do # rubocop:disable RSpec/BeforeAfterAll
  5. create(:object_manager_attribute_date, name: 'rspec_date', default: 24)
  6. create(:object_manager_attribute_datetime, name: 'rspec_datetime', default: 24)
  7. ObjectManager::Attribute.migration_execute
  8. end
  9. after :all do # rubocop:disable RSpec/BeforeAfterAll
  10. ObjectManager::Attribute.where('name LIKE ?', 'rspec_%').destroy_all
  11. end
  12. it 'unsets diff migration' do
  13. migrate
  14. expect(create(:ticket)).to have_attributes(rspec_date: nil, rspec_datetime: nil)
  15. end
  16. end