projects/aports·blob master · refs

40 lines · 2.4 KiB

1From b6934d04a494a3d3014307507c25af4cca3f4f59 Mon Sep 17 00:00:00 2001
2From: daurnimator <[email protected]>
3Date: Sun, 20 Jun 2021 00:24:45 +1000
4Subject: [PATCH] spec/cookie_spec: bump timestamp in test
5
6---
7 spec/cookie_spec.lua | 6 +++---
8 1 file changed, 3 insertions(+), 3 deletions(-)
9
10diff --git a/spec/cookie_spec.lua b/spec/cookie_spec.lua
11index d80c93e..b8866fd 100644
12--- a/spec/cookie_spec.lua
13+++ b/spec/cookie_spec.lua
14@@ -26,7 +26,7 @@ describe("cookie module", function()
15 it(":get works", function()
16 local s = http_cookie.new_store()
17 assert.same(nil, s:get("mysite.com", "/", "lang"))
18- local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")
19+ local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")
20 assert(s:store("mysite.com", "/", true, true, nil, key, value, params))
21 assert.same("en-US", s:get("mysite.com", "/", "lang"))
22 assert.same(nil, s:get("other.com", "/", "lang"))
23@@ -68,7 +68,7 @@ describe("cookie module", function()
24 s.time = function() return 1234567890 end -- set time to something before the expiry
25 -- in spec this is kept from previous example.
26 assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("SID=31d4d96e407aad42; Path=/; Secure; HttpOnly")))
27- assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
28+ assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
29 assert.same("SID=31d4d96e407aad42; lang=en-US", s:lookup("example.com", "/", true, true))
30 s.time = function() return 9234567890 end -- set time to something after the expiry
31 assert.same("SID=31d4d96e407aad42", s:lookup("example.com", "/", true, true))
32@@ -251,7 +251,7 @@ describe("cookie module", function()
33 end)
34 it("cleans up", function()
35 local s = http_cookie.new_store()
36- assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
37+ assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
38 assert.same("foo", s:get("example.com", "/", "foo"))
39 s.time = function() return 9876543210 end -- set time to something after the expiry
40 s:clean()