aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/render_other_test.rb
blob: b5e74e373d48507d8db411f550064581c5d3655f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

  tests TestController

  def test_using_custom_render_option
    get :render_simon_says
    assert_equal "Simon says: foo", @response.body
  end
end