Skip to content

Commit

Permalink
spec/cookie_spec: bump timestamp in test
Browse files Browse the repository at this point in the history
  • Loading branch information
daurnimator committed Jun 19, 2021
1 parent 54606a9 commit b6934d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/cookie_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("cookie module", function()
it(":get works", function()
local s = http_cookie.new_store()
assert.same(nil, s:get("mysite.com", "/", "lang"))
local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")
local key, value, params = http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")
assert(s:store("mysite.com", "/", true, true, nil, key, value, params))
assert.same("en-US", s:get("mysite.com", "/", "lang"))
assert.same(nil, s:get("other.com", "/", "lang"))
Expand Down Expand Up @@ -68,7 +68,7 @@ describe("cookie module", function()
s.time = function() return 1234567890 end -- set time to something before the expiry
-- in spec this is kept from previous example.
assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("SID=31d4d96e407aad42; Path=/; Secure; HttpOnly")))
assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
assert(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("lang=en-US; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
assert.same("SID=31d4d96e407aad42; lang=en-US", s:lookup("example.com", "/", true, true))
s.time = function() return 9234567890 end -- set time to something after the expiry
assert.same("SID=31d4d96e407aad42", s:lookup("example.com", "/", true, true))
Expand Down Expand Up @@ -251,7 +251,7 @@ describe("cookie module", function()
end)
it("cleans up", function()
local s = http_cookie.new_store()
assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2021 10:18:14 GMT")))
assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=foo; Expires=Wed, 09 Jun 2121 10:18:14 GMT")))
assert.same("foo", s:get("example.com", "/", "foo"))
s.time = function() return 9876543210 end -- set time to something after the expiry
s:clean()
Expand Down

0 comments on commit b6934d0

Please sign in to comment.