Permalink
Browse files

No variant should also be picked up by variant.any if variant.none is…

… not defined (just like any other variant)
  • Loading branch information...
dhh committed Feb 13, 2014
1 parent f9e4c3c commit bfc34fc0050ce61650701676dd45553aa82214c0
@@ -532,7 +532,7 @@ def method_missing(name, *args, &block)
def variant
if @variant.nil?
- @variants[:none]
+ @variants[:none] || @variants[:any]
elsif (@variants.keys & @variant).any?
@variant.each do |v|
return @variants[v] if @variants.key?(v)
@@ -671,6 +671,10 @@ def test_variant_any
end
def test_variant_any_any
+ get :variant_any_any
+ assert_equal "text/html", @response.content_type
+ assert_equal "any", @response.body
+
@request.variant = :phone
get :variant_any_any
assert_equal "text/html", @response.content_type

0 comments on commit bfc34fc

Please sign in to comment.