aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/content_negotiation_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-03 21:05:51 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-03 21:05:51 -0500
commit018b79dd36d054d87fdc408d38dc9ac7f1b1500d (patch)
treea954ecef58682b2d259432a04ce503f8bb865840 /actionpack/test/controller/new_base/content_negotiation_test.rb
parent84e94551f62d3bcbc71f1c6f3fda738342d984e2 (diff)
downloadrails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.tar.gz
rails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.tar.bz2
rails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.zip
File extra test folders into controller, dispatch, or template
Diffstat (limited to 'actionpack/test/controller/new_base/content_negotiation_test.rb')
-rw-r--r--actionpack/test/controller/new_base/content_negotiation_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_base/content_negotiation_test.rb b/actionpack/test/controller/new_base/content_negotiation_test.rb
new file mode 100644
index 0000000000..c43cb677f8
--- /dev/null
+++ b/actionpack/test/controller/new_base/content_negotiation_test.rb
@@ -0,0 +1,18 @@
+require 'abstract_unit'
+
+module ContentNegotiation
+
+ # This has no layout and it works
+ class BasicController < ActionController::Base
+ self.view_paths = [ActionView::FixtureResolver.new(
+ "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats %>!"
+ )]
+ end
+
+ class TestContentNegotiation < SimpleRouteCase
+ test "A */* Accept header will return HTML" do
+ get "/content_negotiation/basic/hello", {}, "HTTP_ACCEPT" => "*/*"
+ assert_body "Hello world */*!"
+ end
+ end
+end