Skip to content

Commit

Permalink
Added test for check_down with safety_assured
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 9, 2024
1 parent f802207 commit 3e7129e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/check_down_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def test_change_safe
end
end

def test_safety_assured
migrate CheckDownSafetyAssured
with_check_down do
assert_unsafe CheckDownSafetyAssured, direction: :down
end
assert_safe CheckDownSafetyAssured, direction: :down
end

def test_add_column
migrate AddColumnDefault
with_check_down do
Expand Down
8 changes: 8 additions & 0 deletions test/migrations/check_down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ def change
remove_index :users, column: :name, algorithm: :concurrently
end
end

class CheckDownSafetyAssured < TestMigration
def change
safety_assured do
add_column :users, :age, :integer
end
end
end

0 comments on commit 3e7129e

Please sign in to comment.