Skip to content

Commit

Permalink
Assert sql_type disregarding case sensitiveness
Browse files Browse the repository at this point in the history
As mentioned here rails#43295 since sqlite3 3.37 sqlite3 returns the type of the columns in capital letters while in versions before it did return in lowercase, matching disregarging case sensitiveness will avoid the tests fail in more recent versions of sqlite3 since what matters is the name of the type and not if it is uppercase or lowercase.

Co-Authored-By: Name <pixeltrix@users.noreply.github.com>
  • Loading branch information
2 people authored and p8 committed Sep 29, 2022
1 parent 33f859d commit 449feb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/migration/compatibility_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def migrate(x)
ActiveRecord::Migrator.new(:up, [migration], @schema_migration).migrate

testings_id_column = connection.columns(:more_testings).find { |el| el.name == "testings_id" }
assert_equal "integer", testings_id_column.sql_type
assert_match(/integer/i, testings_id_column.sql_type)
ensure
connection.drop_table :more_testings rescue nil
end
Expand All @@ -307,7 +307,7 @@ def migrate(x)
ActiveRecord::Migrator.new(:up, [create_migration, migration], @schema_migration).migrate

testings_id_column = connection.columns(:more_testings).find { |el| el.name == "testings_id" }
assert_equal "integer", testings_id_column.sql_type
assert_match(/integer/i, testings_id_column.sql_type)
ensure
connection.drop_table :more_testings rescue nil
end
Expand Down

0 comments on commit 449feb5

Please sign in to comment.