@@ -71,8 +71,8 @@ def test_quoted_time_utc
71
71
with_timezone_config default : :utc do
72
72
t = Time . now . change ( usec : 0 )
73
73
74
- expected = t . getutc . change ( year : 2000 , month : 1 , day : 1 )
75
- expected = expected . to_s ( :db ) . sub ( "2000-01-01 " , "" )
74
+ expected = t . change ( year : 2000 , month : 1 , day : 1 )
75
+ expected = expected . getutc . to_s ( :db ) . slice ( 11 ..- 1 )
76
76
77
77
assert_equal expected , @quoter . quoted_time ( t )
78
78
end
@@ -89,6 +89,28 @@ def test_quoted_time_local
89
89
end
90
90
end
91
91
92
+ def test_quoted_time_dst_utc
93
+ with_timezone_config default : :utc do
94
+ t = Time . new ( 2000 , 7 , 1 , 0 , 0 , 0 , "+04:30" )
95
+
96
+ expected = t . change ( year : 2000 , month : 1 , day : 1 )
97
+ expected = expected . getutc . to_s ( :db ) . slice ( 11 ..-1 )
98
+
99
+ assert_equal expected , @quoter . quoted_time ( t )
100
+ end
101
+ end
102
+
103
+ def test_quoted_time_dst_local
104
+ with_timezone_config default : :local do
105
+ t = Time . new ( 2000 , 7 , 1 , 0 , 0 , 0 , "+04:30" )
106
+
107
+ expected = t . change ( year : 2000 , month : 1 , day : 1 )
108
+ expected = expected . getlocal . to_s ( :db ) . slice ( 11 ..-1 )
109
+
110
+ assert_equal expected , @quoter . quoted_time ( t )
111
+ end
112
+ end
113
+
92
114
def test_quoted_time_crazy
93
115
with_timezone_config default : :asdfasdf do
94
116
t = Time . now . change ( usec : 0 )
0 commit comments