0
@@ -107,7 +107,7 @@ class RespondToController < ActionController::Base
0
type.any(:js, :xml) { render :text => "Either JS or XML" }
0
type.html { render :text => 'HTML' }
0
@@ -120,12 +120,12 @@ class RespondToController < ActionController::Base
0
- def iphone_with_html_response_type
0
+ def iphone_with_html_response_type
0
Mime::Type.register_alias("text/html", :iphone)
0
request.format = :iphone if request.env["HTTP_ACCEPT"] == "text/iphone"
0
type.html { @type = "Firefox" }
0
type.iphone { @type = "iPhone" }
0
@@ -138,7 +138,7 @@ class RespondToController < ActionController::Base
0
def iphone_with_html_response_type_without_layout
0
Mime::Type.register_alias("text/html", :iphone)
0
request.format = "iphone" if request.env["HTTP_ACCEPT"] == "text/iphone"
0
type.html { @type = "Firefox"; render :action => "iphone_with_html_response_type" }
0
type.iphone { @type = "iPhone" ; render :action => "iphone_with_html_response_type" }
0
@@ -162,7 +162,7 @@ class RespondToController < ActionController::Base
0
-RespondToController.view_paths = [
File.dirname(__FILE__) + "/../fixtures/" ]
0
+RespondToController.view_paths = [
FIXTURE_LOAD_PATH]
0
class MimeControllerTest < Test::Unit::TestCase
0
@@ -247,7 +247,7 @@ class MimeControllerTest < Test::Unit::TestCase
0
assert_equal 'XML', @response.body
0
def test_using_defaults
0
@request.env["HTTP_ACCEPT"] = "*/*"
0
@@ -347,12 +347,12 @@ class MimeControllerTest < Test::Unit::TestCase
0
assert_equal 'HTML', @response.body
0
def test_handle_any_any_parameter_format
0
get :handle_any_any, {:format=>'html'}
0
assert_equal 'HTML', @response.body
0
def test_handle_any_any_explicit_html
0
@request.env["HTTP_ACCEPT"] = "text/html"
0
@@ -364,7 +364,7 @@ class MimeControllerTest < Test::Unit::TestCase
0
assert_equal 'Whatever you ask for, I got it', @response.body
0
def test_handle_any_any_xml
0
@request.env["HTTP_ACCEPT"] = "text/xml"
0
@@ -445,31 +445,31 @@ class MimeControllerTest < Test::Unit::TestCase
0
get :using_defaults, :format => "xml"
0
assert_equal "using_defaults - xml", @response.body
0
def test_format_with_custom_response_type
0
get :iphone_with_html_response_type
0
- assert_equal '<html><div id="html">Hello future from Firefox!</div></html>', @response.body
0
+ assert_equal '<html><div id="html">Hello future from Firefox!</div></html>', @response.body
0
get :iphone_with_html_response_type, :format => "iphone"
0
assert_equal "text/html", @response.content_type
0
assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
0
def test_format_with_custom_response_type_and_request_headers
0
@request.env["HTTP_ACCEPT"] = "text/iphone"
0
get :iphone_with_html_response_type
0
assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
0
assert_equal "text/html", @response.content_type
0
def test_format_with_custom_response_type_and_request_headers_with_only_one_layout_present
0
get :iphone_with_html_response_type_without_layout
0
- assert_equal '<html><div id="html_missing">Hello future from Firefox!</div></html>', @response.body
0
+ assert_equal '<html><div id="html_missing">Hello future from Firefox!</div></html>', @response.body
0
@request.env["HTTP_ACCEPT"] = "text/iphone"
0
assert_raises(ActionView::MissingTemplate) { get :iphone_with_html_response_type_without_layout }
0
class AbstractPostController < ActionController::Base
0
@@ -497,7 +497,7 @@ class PostController < AbstractPostController
0
-class SuperPostController < PostController
0
+class SuperPostController < PostController
0
@@ -514,25 +514,24 @@ class MimeControllerLayoutsTest < Test::Unit::TestCase
0
@controller = PostController.new
0
@request.host = "www.example.com"
0
def test_missing_layout_renders_properly
0
- assert_equal '<html><div id="html">Hello Firefox</div></html>', @response.body
0
+ assert_equal '<html><div id="html">Hello Firefox</div></html>', @response.body
0
@request.env["HTTP_ACCEPT"] = "text/iphone"
0
assert_equal 'Hello iPhone', @response.body
0
def test_format_with_inherited_layouts
0
@controller = SuperPostController.new
0
assert_equal 'Super Firefox', @response.body
0
@request.env["HTTP_ACCEPT"] = "text/iphone"
0
assert_equal '<html><div id="super_iphone">Super iPhone</div></html>', @response.body