Merge pull request #18884 from rails/fix-kwarg-on-stale

Fix wrong kwarg "record" from #18872
This commit is contained in:
Rafael Mendonça França 2015-02-10 23:05:53 -02:00
commit 17d9996c91
2 changed files with 2 additions and 1 deletions

@ -155,7 +155,7 @@ def fresh_when(record = nil, etag: record, last_modified: nil, public: false, te
# super if stale? @article, template: 'widgets/show'
# end
#
def stale?(record = nil, etag: nil, last_modified: nil, public: nil, template: nil)
def stale?(record = nil, etag: record, last_modified: nil, public: nil, template: nil)
fresh_when(record, etag: etag, last_modified: last_modified, public: public, template: template)
!request.fresh?(response)
end

@ -299,6 +299,7 @@ def test_request_not_modified_with_record
get :conditional_hello_with_record
assert_equal 304, @response.status.to_i
assert @response.body.blank?
assert_not_nil @response.etag
assert_equal @last_modified, @response.headers['Last-Modified']
end