File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
actionpack/test/controller/session Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -199,29 +199,17 @@ def test_session_store_with_expire_after
199
199
200
200
with_test_route_set do
201
201
# First request accesses the session
202
- time = Time . local ( 2008 , 4 , 24 )
203
- Time . stubs ( :now ) . returns ( time )
204
- expected_expiry = ( time + 5 . hours ) . gmtime . strftime ( "%a, %d-%b-%Y %H:%M:%S GMT" )
205
-
206
202
cookies [ SessionKey ] = SignedBar
207
203
208
204
get '/set_session_value'
209
205
assert_response :success
206
+ cookie = headers [ 'Set-Cookie' ]
210
207
211
- cookie_body = response . body
212
- assert_equal "_myapp_session=#{ cookie_body } ; path=/; expires=#{ expected_expiry } ; HttpOnly" ,
213
- headers [ 'Set-Cookie' ]
214
-
215
- # Second request does not access the session
216
- time = Time . local ( 2008 , 4 , 25 )
217
- Time . stubs ( :now ) . returns ( time )
218
- expected_expiry = ( time + 5 . hours ) . gmtime . strftime ( "%a, %d-%b-%Y %H:%M:%S GMT" )
219
-
208
+ # Second request does not access the session so the
209
+ # expires header should not be changed
220
210
get '/no_session_access'
221
211
assert_response :success
222
-
223
- assert_equal "_myapp_session=#{ cookie_body } ; path=/; expires=#{ expected_expiry } ; HttpOnly" ,
224
- headers [ 'Set-Cookie' ]
212
+ assert_equal cookie , headers [ 'Set-Cookie' ]
225
213
end
226
214
end
227
215
You can’t perform that action at this time.
0 commit comments