From fadd1fa3d314639067404403651de52a7d2b72f7 Mon Sep 17 00:00:00 2001 From: mathieuravaux Date: Sun, 27 Feb 2011 01:52:08 +0100 Subject: Fixes ticket #6379. Improved the handling of Accept headers containing */*. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lookup_context#formats=` being too restrictive, "Accept: text/javascript, */*" resulted in [:js, "*/*"] formats instead of [:js, :html]. Signed-off-by: José Valim --- actionpack/test/template/lookup_context_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index 5fb1fdc044..e7680bc022 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 -- cgit v1.2.3