提交 81d08abc 编写于 作者: R Rafael Mendonça França

Merge pull request #14363 from arthurnn/usec_tests_mysql56

Add more tests for mysql 5.6 microseconds + Fix tests
......@@ -97,6 +97,13 @@ def test_logs_name_rename_column_sql
@connection.execute "DROP TABLE `bar_baz`"
end
if mysql_56?
def test_quote_time_usec
assert_equal "'1970-01-01 00:00:00.000000'", @connection.quote(Time.at(0))
assert_equal "'1970-01-01 00:00:00.000000'", @connection.quote(Time.at(0).to_datetime)
end
end
private
def run_without_connection
......
......@@ -452,7 +452,7 @@ def test_update_attribute_with_one_updated
def test_update_attribute_for_updated_at_on
developer = Developer.find(1)
prev_month = Time.now.prev_month
prev_month = Time.now.prev_month.change(usec: 0)
developer.update_attribute(:updated_at, prev_month)
assert_equal prev_month, developer.updated_at
......@@ -523,7 +523,7 @@ def test_update_column_for_readonly_attribute
def test_update_column_should_not_modify_updated_at
developer = Developer.find(1)
prev_month = Time.now.prev_month
prev_month = Time.now.prev_month.change(usec: 0)
developer.update_column(:updated_at, prev_month)
assert_equal prev_month, developer.updated_at
......@@ -620,7 +620,7 @@ def test_update_columns_with_one_readonly_attribute
def test_update_columns_should_not_modify_updated_at
developer = Developer.find(1)
prev_month = Time.now.prev_month
prev_month = Time.now.prev_month.change(usec: 0)
developer.update_columns(updated_at: prev_month)
assert_equal prev_month, developer.updated_at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册