diff options
author | Josh Susser <josh@hasmanythrough.com> | 2012-12-06 08:34:00 -0800 |
---|---|---|
committer | Josh Susser <josh@hasmanythrough.com> | 2012-12-06 09:08:10 -0800 |
commit | dba022f3a9f1c0e256ae290ffffd332f7a9fd250 (patch) | |
tree | b4554f0dd0f525a64862267958bdc398bf61497b /activerecord | |
parent | 5a8f25f003f022ebc6986b20b0c10329e9553dc3 (diff) | |
download | rails-dba022f3a9f1c0e256ae290ffffd332f7a9fd250.tar.gz rails-dba022f3a9f1c0e256ae290ffffd332f7a9fd250.tar.bz2 rails-dba022f3a9f1c0e256ae290ffffd332f7a9fd250.zip |
convert time to string
why is this a Time to start with?
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/schema_migration_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 60e5a29965..3a861d887f 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -71,7 +71,7 @@ class MigrationTest < ActiveRecord::TestCase assert_equal m0_fingerprint, rows[0]["fingerprint"] assert_equal "valid_people_have_last_names", rows[0]["name"] rows.each do |row| - assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"], "missing migrated_at") + assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"].to_s, "missing migrated_at") # sometimes a String, sometimes a Time end ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/valid") diff --git a/activerecord/test/cases/schema_migration_test.rb b/activerecord/test/cases/schema_migration_test.rb index 34b9fa520a..882067a7d4 100644 --- a/activerecord/test/cases/schema_migration_test.rb +++ b/activerecord/test/cases/schema_migration_test.rb @@ -40,7 +40,7 @@ class SchemaMigrationTest < ActiveRecord::TestCase rows = connection.select_all("SELECT * FROM #{connection.quote_table_name(sm_table_name)}") assert rows[0].has_key?("migrated_at"), "missing column `migrated_at`" - assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"]) + assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"].to_s) # sometimes a String, sometimes a Time assert rows[0].has_key?("fingerprint"), "missing column `fingerprint`" assert rows[0].has_key?("name"), "missing column `name`" end |