提交 f5fba917 编写于 作者: N Neeraj Singh 提交者: José Valim

failing test for #6022

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 61950a4b
......@@ -2,6 +2,14 @@
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 @@ def set_layout
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册