aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base/content_negotiation_test.rb
blob: a2f9df597f11042946a36a71d85c47fccb0afc8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'abstract_unit2'

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