rails--rails/actionpack/test/controller/render_other_test.rb

22 lines
484 B
Ruby
Raw Normal View History

2009-05-14 00:00:36 +00:00
require 'abstract_unit'
ActionController.add_renderer :simon do |says, options|
self.content_type = Mime::TEXT
self.response_body = "Simon says: #{says}"
end
class RenderOtherTest < ActionController::TestCase
class TestController < ActionController::Base
def render_simon_says
render :simon => "foo"
end
end
2009-05-14 00:00:36 +00:00
tests TestController
def test_using_custom_render_option
get :render_simon_says
assert_equal "Simon says: foo", @response.body
end
end