aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorTom Ward <tom@popdog.net>2008-07-18 20:14:12 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-18 20:14:12 -0500
commitc3d1fda555c4bd5f8821d830c685ae5d0e7e52d0 (patch)
tree41a5e9b018d724a82c33ab117bc1e6403e6cbbc5 /actionpack/test
parentd2ccb852d4e1f6f1b01e43f32213053ae3bef408 (diff)
downloadrails-c3d1fda555c4bd5f8821d830c685ae5d0e7e52d0.tar.gz
rails-c3d1fda555c4bd5f8821d830c685ae5d0e7e52d0.tar.bz2
rails-c3d1fda555c4bd5f8821d830c685ae5d0e7e52d0.zip
Set the response content type to that of found template if not explicitly set elsewhere [#444 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb15
-rw-r--r--actionpack/test/fixtures/test/implicit_content_type.atom.builder2
2 files changed, 12 insertions, 5 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 041c54c7fd..76832f5713 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -197,11 +197,11 @@ class TestController < ActionController::Base
def render_alternate_default
# For this test, the method "default_render" is overridden:
- @alternate_default_render = lambda {
- render :update do |page|
- page.replace :foo, :partial => 'partial'
- end
- }
+ @alternate_default_render = lambda do
+ render :update do |page|
+ page.replace :foo, :partial => 'partial'
+ end
+ end
end
def rescue_action(e) raise end
@@ -467,6 +467,11 @@ class RenderTest < Test::Unit::TestCase
get :render_xml_with_custom_content_type
assert_equal "application/atomsvc+xml", @response.content_type
end
+
+ def test_should_use_implicit_content_type
+ get :implicit_content_type, :format => 'atom'
+ assert_equal Mime::ATOM, @response.content_type
+ end
end
class EtagRenderTest < Test::Unit::TestCase
diff --git a/actionpack/test/fixtures/test/implicit_content_type.atom.builder b/actionpack/test/fixtures/test/implicit_content_type.atom.builder
new file mode 100644
index 0000000000..2fcb32d247
--- /dev/null
+++ b/actionpack/test/fixtures/test/implicit_content_type.atom.builder
@@ -0,0 +1,2 @@
+xml.atom do
+end