This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class TestRegressions < MiniTest::Test | ||
|
||
# | ||
# Bugfix tests to ensure we don't allow regressions | ||
# | ||
# https://github.com/aw/CacheRules/issues | ||
|
||
def setup | ||
@cached_headers = { | ||
:cached => { | ||
"Date" => {"httpdate"=>"Thu, 01 Jan 2015 07:03:45 GMT", "timestamp"=>1420095825}, | ||
"Cache-Control" => { | ||
"public" => {"token"=>nil, "quoted_string"=>nil} | ||
}, | ||
"X-Cache-Req-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625}, | ||
"X-Cache-Res-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625} | ||
} | ||
} | ||
end | ||
|
||
# https://github.com/aw/CacheRules/issues/5 | ||
def test_bugfix_5_age_header_string_integer | ||
age_string = CacheRules.action_add_age @cached_headers | ||
age_integer = CacheRules.helper_corrected_initial_age({}, Proc.new { 100 }, Proc.new { 99 }).call | ||
|
||
assert_kind_of String, age_string['Age'] | ||
assert_kind_of Integer, age_integer | ||
end | ||
end |