Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-chimp committed Dec 5, 2024
1 parent a951d10 commit ebc56c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions activerecord/test/cases/migration/columns_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,17 @@ def test_change_column_null_with_non_boolean_arguments_raises
end

def test_change_column_null_does_not_change_default_functions
skip unless current_adapter?(:Mysql2Adapter, :TrilogyAdapter)
skip unless current_adapter?(:Mysql2Adapter, :TrilogyAdapter) && supports_default_expression?

connection.change_column_default "test_models", "created_at", -> { "(NOW())" }
function = connection.mariadb? ? "(current_timestamp())" : "(now())"

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

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

def test_remove_column_no_second_parameter_raises_exception
Expand Down

0 comments on commit ebc56c3

Please sign in to comment.