mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
failing test for #6022
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
61950a4b05
commit
f5fba917f8
1 changed files with 34 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue