{"action":"created","issue":{"url":"https://api.github.com/repos/TracksApp/tracks/issues/1809","labels_url":"https://api.github.com/repos/TracksApp/tracks/issues/1809/labels{/name}","comments_url":"https://api.github.com/repos/TracksApp/tracks/issues/1809/comments","events_url":"https://api.github.com/repos/TracksApp/tracks/issues/1809/events","html_url":"https://github.com/TracksApp/tracks/pull/1809","id":67911682,"number":1809,"title":"Freeze time in tests","user":{"login":"C-Otto","id":344948,"avatar_url":"https://avatars.githubusercontent.com/u/344948?v=3","gravatar_id":"","url":"https://api.github.com/users/C-Otto","html_url":"https://github.com/C-Otto","followers_url":"https://api.github.com/users/C-Otto/followers","following_url":"https://api.github.com/users/C-Otto/following{/other_user}","gists_url":"https://api.github.com/users/C-Otto/gists{/gist_id}","starred_url":"https://api.github.com/users/C-Otto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/C-Otto/subscriptions","organizations_url":"https://api.github.com/users/C-Otto/orgs","repos_url":"https://api.github.com/users/C-Otto/repos","events_url":"https://api.github.com/users/C-Otto/events{/privacy}","received_events_url":"https://api.github.com/users/C-Otto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-12T12:53:20Z","updated_at":"2015-04-12T17:31:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TracksApp/tracks/pulls/1809","html_url":"https://github.com/TracksApp/tracks/pull/1809","diff_url":"https://github.com/TracksApp/tracks/pull/1809.diff","patch_url":"https://github.com/TracksApp/tracks/pull/1809.patch"},"body":"fix #1760 by not advancing the time during the tests"},"comment":{"url":"https://api.github.com/repos/TracksApp/tracks/issues/comments/92092877","html_url":"https://github.com/TracksApp/tracks/pull/1809#issuecomment-92092877","issue_url":"https://api.github.com/repos/TracksApp/tracks/issues/1809","id":92092877,"user":{"login":"dnrce","id":1084619,"avatar_url":"https://avatars.githubusercontent.com/u/1084619?v=3","gravatar_id":"","url":"https://api.github.com/users/dnrce","html_url":"https://github.com/dnrce","followers_url":"https://api.github.com/users/dnrce/followers","following_url":"https://api.github.com/users/dnrce/following{/other_user}","gists_url":"https://api.github.com/users/dnrce/gists{/gist_id}","starred_url":"https://api.github.com/users/dnrce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnrce/subscriptions","organizations_url":"https://api.github.com/users/dnrce/orgs","repos_url":"https://api.github.com/users/dnrce/repos","events_url":"https://api.github.com/users/dnrce/events{/privacy}","received_events_url":"https://api.github.com/users/dnrce/received_events","type":"User","site_admin":false},"created_at":"2015-04-12T17:31:30Z","updated_at":"2015-04-12T17:31:30Z","body":"The main problem with the tests is that the fixtures are loaded at the beginning of the test suite, whereas the tests themselves assume that fixture data was created at the time the individual test is run. To me, that's the only valid excuse for freezing time globally. Other specific cases should be addressed more directly and more granularly.\r\n\r\nApplication code should not use `Time.now` (actually, `Time.current` is better, but that's another story) more than once within a method, either. If multiple relative times are needed, the method should store a temporary time object and create other times relative to it. If we're not doing that, it's a bug."}}