diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-12 14:07:10 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-12 14:07:10 -0300 |
commit | 81d08abcccf2ef1b0ea6e98daf00f6ca375f3d8a (patch) | |
tree | f343d187d9f4c72c3826a0fd966e423e92fef55c | |
parent | 591b8f395d101ad1a3b009b98de0e6bd2a5d6222 (diff) | |
parent | 7058321725ba0054390a65d8f6343613df31eea9 (diff) | |
download | rails-81d08abcccf2ef1b0ea6e98daf00f6ca375f3d8a.tar.gz rails-81d08abcccf2ef1b0ea6e98daf00f6ca375f3d8a.tar.bz2 rails-81d08abcccf2ef1b0ea6e98daf00f6ca375f3d8a.zip |
Merge pull request #14363 from arthurnn/usec_tests_mysql56
Add more tests for mysql 5.6 microseconds + Fix tests
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/connection_test.rb | 7 | ||||
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/connection_test.rb b/activerecord/test/cases/adapters/mysql2/connection_test.rb index 9b7202c915..98febd2d75 100644 --- a/activerecord/test/cases/adapters/mysql2/connection_test.rb +++ b/activerecord/test/cases/adapters/mysql2/connection_test.rb @@ -97,6 +97,13 @@ class MysqlConnectionTest < ActiveRecord::TestCase @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 diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index b9f0624f76..046fe83e54 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -452,7 +452,7 @@ class PersistenceTest < ActiveRecord::TestCase 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 @@ class PersistenceTest < ActiveRecord::TestCase 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 @@ class PersistenceTest < ActiveRecord::TestCase 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 |