-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cookie_helper to manage different expires value.
- Loading branch information
1 parent
b349c12
commit 1dc9799
Showing
4 changed files
with
30 additions
and
14 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
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
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Spec | ||
module Support | ||
module Helpers | ||
def cookie_expires_value | ||
@cookie_expired ||= Gem::Version.new(Rack.release) <= Gem::Version.new('2') ? Time.at(0).gmtime.rfc2822 : Time.at(0).httpdate | ||
end | ||
|
||
def last_response_cookies | ||
Array(last_response.headers['Set-Cookie']).flat_map { |h| h.split("\n") }.sort | ||
end | ||
end | ||
end | ||
end |