@@ -1759,7 +1759,9 class QueryTest < ActiveSupport::TestCase | |||||
1759 | assert c = @query.send(:date_clause, 'table', 'field', from, to, false) |
|
1759 | assert c = @query.send(:date_clause, 'table', 'field', from, to, false) | |
1760 | # the dates should have been interpreted in the user's time zone and |
|
1760 | # the dates should have been interpreted in the user's time zone and | |
1761 | # converted to utc. March 20 in Hawaii begins at 10am UTC. |
|
1761 | # converted to utc. March 20 in Hawaii begins at 10am UTC. | |
1762 | assert_equal "table.field > '2016-03-20 09:59:59.999999' AND table.field <= '2016-03-23 09:59:59.999999'", c |
|
1762 | f = Time.new(2016, 3, 20, 9, 59, 59, 0).end_of_hour | |
|
1763 | t = Time.new(2016, 3, 23, 9, 59, 59, 0).end_of_hour | |||
|
1764 | assert_equal "table.field > '#{Query.connection.quoted_date f}' AND table.field <= '#{Query.connection.quoted_date t}'", c | |||
1763 | ensure |
|
1765 | ensure | |
1764 | ActiveRecord::Base.default_timezone = :local # restore Redmine default |
|
1766 | ActiveRecord::Base.default_timezone = :local # restore Redmine default | |
1765 | end |
|
1767 | end |
General Comments 0
You need to be logged in to leave comments.
Login now