From 9cfb319c43be36e0921fba9c0ac155fb72f0dc34 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 May 2016 18:30:59 +0000 Subject: [PATCH] Test failure with SQLServer (#22320). git-svn-id: http://svn.redmine.org/redmine/trunk@15392 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/query_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 334f4e479..2515624d8 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1759,7 +1759,9 @@ class QueryTest < ActiveSupport::TestCase assert c = @query.send(:date_clause, 'table', 'field', from, to, false) # the dates should have been interpreted in the user's time zone and # converted to utc. March 20 in Hawaii begins at 10am UTC. - assert_equal "table.field > '2016-03-20 09:59:59.999999' AND table.field <= '2016-03-23 09:59:59.999999'", c + f = Time.new(2016, 3, 20, 9, 59, 59, 0).end_of_hour + t = Time.new(2016, 3, 23, 9, 59, 59, 0).end_of_hour + assert_equal "table.field > '#{Query.connection.quoted_date f}' AND table.field <= '#{Query.connection.quoted_date t}'", c ensure ActiveRecord::Base.default_timezone = :local # restore Redmine default end -- 2.39.5