Sha256: 7903af1641f9e9cd4c1c9b9bc441d0af580e2c2928c9e1e8e0e11e5157caec66

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 rails/actionpack/test/controller/render_other_test.rb
activejob-lock-0.0.1 rails/actionpack/test/controller/render_other_test.rb