Skip to content

Commit

Permalink
Fix test for mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-chimp committed Dec 5, 2024
1 parent ebc56c3 commit 428d4e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/test/cases/migration/columns_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,15 @@ def test_change_column_null_with_non_boolean_arguments_raises
def test_change_column_null_does_not_change_default_functions
skip unless current_adapter?(:Mysql2Adapter, :TrilogyAdapter) && supports_default_expression?

function = connection.mariadb? ? "(current_timestamp())" : "(now())"
expected_function = connection.mariadb? ? "current_timestamp()" : "(now())"

connection.change_column_default "test_models", "created_at", -> { function }
connection.change_column_default "test_models", "created_at", -> { "(now())" }
TestModel.reset_column_information
assert_equal function, TestModel.columns_hash["created_at"].default_function
assert_equal expected_function, TestModel.columns_hash["created_at"].default_function

connection.change_column_null "test_models", "created_at", true
TestModel.reset_column_information
assert_equal function, TestModel.columns_hash["created_at"].default_function
assert_equal expected_function, TestModel.columns_hash["created_at"].default_function
end

def test_remove_column_no_second_parameter_raises_exception
Expand Down

0 comments on commit 428d4e1

Please sign in to comment.