aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-04 00:23:58 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-04 00:38:27 +0100
commitf000d4e5faeabafece59a46911a74e876785b785 (patch)
tree73811693d0153e4f745ce1159c34bcca1ba2e00a /activerecord/test/fixtures
parent7d4321711ebb99d2669c02b2030ade0de69655af (diff)
downloadrails-f000d4e5faeabafece59a46911a74e876785b785.tar.gz
rails-f000d4e5faeabafece59a46911a74e876785b785.tar.bz2
rails-f000d4e5faeabafece59a46911a74e876785b785.zip
Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved.
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/pirates.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/fixtures/pirates.yml b/activerecord/test/fixtures/pirates.yml
index abb91101da..6004f390a4 100644
--- a/activerecord/test/fixtures/pirates.yml
+++ b/activerecord/test/fixtures/pirates.yml
@@ -5,5 +5,5 @@ blackbeard:
redbeard:
catchphrase: "Avast!"
parrot: louis
- created_on: <%= 2.weeks.ago.to_s(:db) %>
- updated_on: <%= 2.weeks.ago.to_s(:db) %>
+ created_on: "<%= 2.weeks.ago.to_s(:db) %>"
+ updated_on: "<%= 2.weeks.ago.to_s(:db) %>"