Fishy things happen when testing time-sensitive SQL queries that my model layer executes. (For instance, queries that return records with a date earlier than the current date).
The application is set to China Standard Time, and I am located in the US when running the tests. Here is some console output that I think points to the underlying problem. I’ve not yet found the solution
# in config/application.rb config.time_zone = "Asia/Shanghai" # in rails console Loading development environment (Rails 4.0.2) 2.0.0p247 :001 > Date.today => Sun, 29 Dec 2013 2.0.0p247 :002 > Date.yesterday => Sun, 29 Dec 2013 2.0.0p247 :003 > Date.tomorrow => Tue, 31 Dec 2013