class MimeControllerLayoutsTest

Public Instance Methods

setup() click to toggle source
Calls superclass method
# File actionpack/test/controller/mime/accept_format_test.rb, line 59
def setup
  super
  @request.host = "www.example.com"
  Mime::Type.register_alias("text/html", :iphone)
end
teardown() click to toggle source
Calls superclass method
# File actionpack/test/controller/mime/accept_format_test.rb, line 65
def teardown
  super
  Mime::Type.unregister(:iphone)
end
test_format_with_inherited_layouts() click to toggle source
# File actionpack/test/controller/mime/accept_format_test.rb, line 79
def test_format_with_inherited_layouts
  @controller = SuperPostController.new

  get :index
  assert_equal '<html><div id="html">Super Firefox</div></html>', @response.body

  @request.accept = "text/iphone"
  get :index
  assert_equal '<html><div id="super_iphone">Super iPhone</div></html>', @response.body
end
test_missing_layout_renders_properly() click to toggle source
# File actionpack/test/controller/mime/accept_format_test.rb, line 70
def test_missing_layout_renders_properly
  get :index
  assert_equal '<html><div id="html">Hello Firefox</div></html>', @response.body

  @request.accept = "text/iphone"
  get :index
  assert_equal "Hello iPhone", @response.body
end
test_non_navigational_format_with_no_template_fallbacks_to_html_template_with_no_layout() click to toggle source
# File actionpack/test/controller/mime/accept_format_test.rb, line 90
def test_non_navigational_format_with_no_template_fallbacks_to_html_template_with_no_layout
  get :index, format: :js
  assert_equal "Hello Firefox", @response.body
end