aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/render_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-17 12:01:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-17 12:01:30 -0700
commitf796ed6088ab1e347fcfe573a6346d1235453156 (patch)
tree81c7e25d21ac4dd5f26bd3c6ca91f8d0be7c2cbf /actionpack/test/controller/render_test.rb
parenteaf54865b1313094ffca16aca1b199394bc58bae (diff)
parent677b64fcd527529390e232ceedf8fa8bfac224e2 (diff)
downloadrails-f796ed6088ab1e347fcfe573a6346d1235453156.tar.gz
rails-f796ed6088ab1e347fcfe573a6346d1235453156.tar.bz2
rails-f796ed6088ab1e347fcfe573a6346d1235453156.zip
Merge branch 'master' into stmt
* master: (330 commits) plugin new missing license spec let Ruby do the is_a check for us Mocha 0.14.0 was released with MT5 support. Switch back to gem Fix named routing regression from 3.2.13 Revert "just call the class method since we know the callbacks are stored at the" test refactor Add more data to AR::UnknownAttributeError Raise when multiple included blocks are defined Revert "Integration tests support the OPTIONS http method" restore whitespace in Gemfile between sqlite3 and sprockets Revert "Add the options method to action_controller testcase." Check if APP_RAKEFILE is defined Fix detection of engine in rake db:load_config Broken by d1d7c86d0c8dcb7e75a87644b330c4e9e7d6c1c1 Remove trailing line break tiny types should only be integers when the length is <= 1. fixes #10620 add failing test exposing mysql adapter tinyint bug require things we need Revert "Merge pull request #10600 from aditya-kapoor/code_refactor" just call the class method since we know the callbacks are stored at the class level this variable is used, so we don't have to use double assignments ...
Diffstat (limited to 'actionpack/test/controller/render_test.rb')
-rw-r--r--actionpack/test/controller/render_test.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 0e5bad7482..72411ec900 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -32,6 +32,10 @@ class TestControllerWithExtraEtags < ActionController::Base
def fresh
render text: "stale" if stale?(etag: '123')
end
+
+ def array
+ render text: "stale" if stale?(etag: %w(1 2 3))
+ end
end
class TestController < ActionController::Base
@@ -1649,7 +1653,6 @@ class LastModifiedRenderTest < ActionController::TestCase
assert_equal @last_modified, @response.headers['Last-Modified']
end
-
def test_request_with_bang_gets_last_modified
get :conditional_hello_with_bangs
assert_equal @last_modified, @response.headers['Last-Modified']
@@ -1678,7 +1681,7 @@ class EtagRenderTest < ActionController::TestCase
end
def test_multiple_etags
- @request.if_none_match = %("#{Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key([ "123", 'ab', :cde, [:f] ]))}")
+ @request.if_none_match = etag(["123", 'ab', :cde, [:f]])
get :fresh
assert_response :not_modified
@@ -1686,6 +1689,20 @@ class EtagRenderTest < ActionController::TestCase
get :fresh
assert_response :success
end
+
+ def test_array
+ @request.if_none_match = etag([%w(1 2 3), 'ab', :cde, [:f]])
+ get :array
+ assert_response :not_modified
+
+ @request.if_none_match = %("nomatch")
+ get :array
+ assert_response :success
+ end
+
+ def etag(record)
+ Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(record)).inspect
+ end
end