aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/test/controller/render_other_test.rb
blob: 8891f6177f96c7f9491d76a5a3511dac210d0ab6 (plain) (tree)
1
2
3
4
5
6
7
8
9
                       
 
 

                                                  


                            
     
 

                      
                                     
                                                           
                                            


                                                

                                                  

                                           
     
   
require 'abstract_unit'


class RenderOtherTest < ActionController::TestCase
  class TestController < ActionController::Base
    def render_simon_says
      render :simon => "foo"
    end
  end

  tests TestController

  def test_using_custom_render_option
    ActionController.add_renderer :simon do |says, options|
      self.content_type  = Mime::Type[:TEXT]
      self.response_body = "Simon says: #{says}"
    end

    get :render_simon_says
    assert_equal "Simon says: foo", @response.body
  ensure
    ActionController.remove_renderer :simon
  end
end