Updated code based on Jocelyn's comments.

This commit is contained in:
jvelilla
2015-03-13 17:41:48 -03:00
parent 871e9792a5
commit 4a35ff7b77
2 changed files with 60 additions and 36 deletions

View File

@@ -20,7 +20,7 @@ feature -- Test routines
l_cookie: HTTP_COOKIE
do
create l_cookie.make ("user_id", "u12345")
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1"))
end
test_cookie_value_with_illegal_characters
@@ -46,7 +46,7 @@ feature -- Test routines
l_cookie.set_path ("/")
l_cookie.set_secure (True)
l_cookie.set_http_only (True)
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
end
test_cookie_include_expires
@@ -60,7 +60,7 @@ feature -- Test routines
l_cookie.set_secure (True)
l_cookie.set_http_only (True)
l_cookie.mark_expires
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
end
test_cookie_full_include_max_age
@@ -74,7 +74,7 @@ feature -- Test routines
l_cookie.set_secure (True)
l_cookie.set_http_only (True)
l_cookie.mark_max_age
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Max-Age=-1; Secure; HttpOnly"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Max-Age=-1; Secure; HttpOnly"))
end
test_cookie_defaults_and_http_only
@@ -83,7 +83,7 @@ feature -- Test routines
do
create l_cookie.make ("user_id", "u12345")
l_cookie.set_http_only (True)
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1; HttpOnly"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1; HttpOnly"))
end
test_cookie_defaults_and_secure
@@ -92,7 +92,7 @@ feature -- Test routines
do
create l_cookie.make ("user_id", "u12345")
l_cookie.set_secure (True)
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1; Secure"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Max-Age=-1; Secure"))
end
@@ -102,7 +102,7 @@ feature -- Test routines
do
create l_cookie.make ("user_id", "u12345")
l_cookie.set_domain ("www.example.com")
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Max-Age=-1"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Max-Age=-1"))
end
@@ -112,7 +112,7 @@ feature -- Test routines
do
create l_cookie.make ("user_id", "u12345")
l_cookie.set_path ("/")
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Path=/; Max-Age=-1"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Path=/; Max-Age=-1"))
end
test_cookie_default_and_custom_max_age
@@ -121,7 +121,7 @@ feature -- Test routines
do
create l_cookie.make ("user_id", "u12345")
l_cookie.set_max_age (120)
assert("Expected", l_cookie.cookie_header.same_string ("Set-Cookie: user_id=u12345; Max-Age=120"))
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Max-Age=120"))
end