diff options
author | eileencodes <eileencodes@gmail.com> | 2015-12-01 14:37:20 -0500 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2015-12-06 15:32:47 -0500 |
commit | 8350925bec434168f56b4fae22b5298cb4a83c41 (patch) | |
tree | 660994ee5d8017b18f418105022fbcf0231176e9 /actionpack/lib/action_dispatch/http | |
parent | 492b134433653cbbea1b30c459d41054f0da5ad7 (diff) | |
download | rails-8350925bec434168f56b4fae22b5298cb4a83c41.tar.gz rails-8350925bec434168f56b4fae22b5298cb4a83c41.tar.bz2 rails-8350925bec434168f56b4fae22b5298cb4a83c41.zip |
Stop violating law of demeter in response cookie_jar
This adds a new method to request and response so we don't need to
violate the law of demeter.
We are changing `Request` and `Response` so that they always have a
`cookie_jar`
This is a continuation on work to combine integration and controller
test code bases in Rails.
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 482917d71b..29cf821090 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -63,6 +63,9 @@ module ActionDispatch @ip = nil end + def commit_cookie_jar! # :nodoc: + end + def check_path_parameters! # If any of the path parameters has an invalid encoding then # raise since it's likely to trigger errors further on. diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index a4852d7031..9a10dc73d9 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -413,7 +413,7 @@ module ActionDispatch # :nodoc: def before_sending headers.freeze - request.cookie_jar.commit! + request.commit_cookie_jar! end def build_buffer(response, body) |