I’m working on an app where builds are done on Travis. We have pages that display different data depending on whether you are looking at the “Yesterday” view or the “Today” view. We test some of these pages using RSpec feature specs.
Unfortunately, I can’t seem to write tests that work properly on both my development environment and on Travis. You are not supposed to use
Timecop.freeze in Capybara tests. Some of the pages send AJAX calls to retrieve data, but they include a date as part of their query, and I think in the hours when Travis (UTC time) and my home (EST time) are on different calendar days that builds fail.
The tests pass on my local machine, and the pages work on Travis during most hours, and they also work in our staging environment on Heroku. Anyone have ideas as to how to handle this?