1
0
Fork 0
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:
Neeraj Singh 2010-11-22 08:53:47 -05:00 committed by José Valim
parent 61950a4b05
commit f5fba917f8

View file

@ -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