docbrown/spec/models/hair_trigger_spec.rb
depfu[bot] b17297ecc6
[ruby] Upgrade hairtrigger: 0.2.25 → 1.0.0 (major) (#19095)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-02-10 11:49:33 -05:00

17 lines
670 B
Ruby

require "rails_helper"
# HairTrigger suggests adding this test to make sure the schema and triggers are aligned
# See https://github.com/jenseng/hair_trigger#testing
RSpec.describe HairTrigger do
describe ".migrations_current?" do
it "is always true" do
# work-around empty AR::Base descendants array caused by with_model cleanup
# HairTrigger uses AR::Base to get database triggers (and compare against the schema)
if ActiveRecord::Base.descendants.blank?
ActiveSupport::DescendantsTracker.store_inherited(ActiveRecord::Base, ApplicationRecord)
end
expect(described_class.migrations_current?).to be(true)
end
end
end