test/upgrade_generator_test.rb in audited-4.7.1 vs test/upgrade_generator_test.rb in audited-4.8.0
- old
+ new
@@ -77,9 +77,19 @@
assert_match(/add_column :audits, :request_uuid, :string/, content)
assert_match(/add_index :audits, :request_uuid/, content)
end
end
+ test "should add 'version' to auditable_index" do
+ load_schema 6
+
+ run_generator %w(upgrade)
+
+ assert_migration "db/migrate/add_version_to_auditable_index.rb" do |content|
+ assert_match(/add_index :audits, \[:auditable_type, :auditable_id, :version\]/, content)
+ end
+ end
+
test "generate migration with correct AR migration parent" do
load_schema 1
run_generator %w(upgrade)