Skip to content

Commit

Permalink
Added test for recognizing */* in accept header.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattalbright committed May 19, 2011
1 parent e0a6400 commit 70766a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions padrino-core/test/test_routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ class TestRouting < Test::Unit::TestCase
assert_equal 'json', body
end

should "set content_type to :json if Accept contains */*" do
mock_app do
get("/foo", :provides => [:json]) { content_type.to_s }
end

get '/foo', {}, { 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' }
assert_equal 'json', body
end

should "send the appropriate number of params" do
mock_app do
get('/id/:user_id', :provides => [:json]) { |user_id| user_id}
Expand Down

0 comments on commit 70766a4

Please sign in to comment.