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.
Add regression tests and update Gemfile.lock / dependencies
- Loading branch information
Showing
3 changed files
with
59 additions
and
16 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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
# Changelog | ||
|
||
## 0.1.8 (2014-02-09) | ||
## 0.1.9 (2015-04-08) | ||
|
||
* Add regression tests for issue #5 | ||
* Update Gemfile.lock / dependencies | ||
* Fix dates in this CHANGELOG | ||
|
||
## 0.1.8 (2015-02-09) | ||
|
||
* Add tests to ensure URLs with query parameters are maintained | ||
|
||
## 0.1.7 (2014-02-02) | ||
## 0.1.7 (2015-02-02) | ||
|
||
* Refactor and simplify `revalidate_response()` method | ||
|
||
## 0.1.6 (2014-02-02) | ||
## 0.1.6 (2015-02-02) | ||
|
||
* Don't rescue ArgumentError on httpdate parse errors | ||
|
||
## 0.1.5 (2014-02-02) | ||
## 0.1.5 (2015-02-02) | ||
|
||
* Closes #3. Returns all cached headers according to RFC 7234 sec4.3.4 | ||
|
||
## 0.1.4 (2014-02-01) | ||
## 0.1.4 (2015-02-01) | ||
|
||
* HTTP `Age` header is now returned as a String, but processed as an Integer |
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
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 |