diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-22 08:53:47 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-22 23:06:12 +0100 |
commit | f5fba917f8dbf45fcbf04b4b26cf54eb3b300057 (patch) | |
tree | c53a5a303ed103b8927f008d783cfe49888acfcd | |
parent | 61950a4b05ce1b5640ac3f3720f9a3368ce95a29 (diff) | |
download | rails-f5fba917f8dbf45fcbf04b4b26cf54eb3b300057.tar.gz rails-f5fba917f8dbf45fcbf04b4b26cf54eb3b300057.tar.bz2 rails-f5fba917f8dbf45fcbf04b4b26cf54eb3b300057.zip |
failing test for #6022
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index c68b3ab13f..2de9b28e68 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -2,6 +2,14 @@ require 'abstract_unit' require 'controller/fake_models' require 'active_support/core_ext/hash/conversions' +class StarStarMimeController < ActionController::Base + layout nil + + def index + render + end +end + class RespondToController < ActionController::Base layout :set_layout @@ -160,6 +168,32 @@ class RespondToController < ActionController::Base end end +class StarStarMimeControllerTest < ActionController::TestCase + tests StarStarMimeController + + def setup; super; end + def teardown; super; end + + def test_javascript_with_format + @request.accept = "text/javascript" + get :index, :format => 'js' + assert_match "function addition(a,b){ return a+b; }", @response.body + end + + def test_javascript_with_no_format + @request.accept = "text/javascript" + get :index + assert_match "function addition(a,b){ return a+b; }", @response.body + end + + def test_javascript_with_no_format_only_star_star + @request.accept = "*/*" + get :index + assert_match "function addition(a,b){ return a+b; }", @response.body + end + +end + class RespondToControllerTest < ActionController::TestCase tests RespondToController |