spec/features/triggers/revert_spec.rb in fx-0.1.0 vs spec/features/triggers/revert_spec.rb in fx-0.2.0
- old
+ new
@@ -31,11 +31,11 @@
example.run
end
end
it "can run reversible migrations for creating triggers" do
- migration = Class.new(ActiveRecord::Migration) do
+ migration = Class.new(migration_class) do
def change
create_trigger :uppercase_users_name, on: :users
end
end
@@ -43,16 +43,16 @@
end
it "can run reversible migrations for dropping triggers" do
connection.create_trigger(:uppercase_users_name, on: :users)
- good_migration = Class.new(ActiveRecord::Migration) do
+ good_migration = Class.new(migration_class) do
def change
drop_trigger :uppercase_users_name, on: :users, revert_to_version: 1
end
end
- bad_migration = Class.new(ActiveRecord::Migration) do
+ bad_migration = Class.new(migration_class) do
def change
drop_trigger :uppercase_users_name, on: :users
end
end
@@ -76,10 +76,10 @@
with_trigger_definition(
name: :uppercase_users_name,
sql_definition: sql_definition,
version: 2,
) do
- migration = Class.new(ActiveRecord::Migration) do
+ migration = Class.new(migration_class) do
def change
update_trigger(
:uppercase_users_name,
on: :users,
version: 2,