Skip to content

Commit

Permalink
Quote these dates to prevent intermittent test failure. Suppose local…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
jonleighton committed Aug 3, 2011
1 parent a173bb3 commit e42c544
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/fixtures/pirates.yml
Expand Up @@ -5,5 +5,5 @@ blackbeard:
redbeard: redbeard:
catchphrase: "Avast!" catchphrase: "Avast!"
parrot: louis parrot: louis
created_on: <%= 2.weeks.ago.to_s(:db) %> created_on: "<%= 2.weeks.ago.to_s(:db) %>"
updated_on: <%= 2.weeks.ago.to_s(:db) %> updated_on: "<%= 2.weeks.ago.to_s(:db) %>"

0 comments on commit e42c544

Please sign in to comment.