From e31da05ee5da6b052014b66f2653cfb7283fda2f Mon Sep 17 00:00:00 2001 From: mathieuravaux Date: Sun, 27 Feb 2011 05:46:52 +0100 Subject: [PATCH] Testcase for ticket #6379: handling of Accept headers containing */* `lookup_context#formats=` being too restrictive, "Accept: text/javascript, */*" resulted in [:js, "*/*"] formats instead of [:js, :html]. --- actionpack/test/template/lookup_context_test.rb | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index 8d063e6..f0de9e9 100644 --- a/actionpack/test/template/lookup_context_test.rb +++ b/actionpack/test/template/lookup_context_test.rb @@ -51,6 +51,11 @@ class LookupContextTest < ActiveSupport::TestCase assert_equal Mime::SET, @lookup_context.formats end + test "handles explicitly defined */* formats fallback to :js" do + @lookup_context.formats = [:js, Mime::ALL] + assert_equal [:js, :html], @lookup_context.formats + end + test "adds :html fallback to :js formats" do @lookup_context.formats = [:js] assert_equal [:js, :html], @lookup_context.formats -- 1.7.3.4