aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRoberto Soares <roberto.tech@gmail.com>2012-11-23 18:10:18 -0300
committerRoberto Soares <roberto.tech@gmail.com>2012-11-23 18:14:35 -0300
commit2d6c4ec731861225779f3106f038effb17a27b21 (patch)
tree9282faa66f30aff799ea75ce6d5c5293083aaa7f /actionpack/lib
parent20723ca49873076d8fc8c2bf0729568373e31738 (diff)
downloadrails-2d6c4ec731861225779f3106f038effb17a27b21.tar.gz
rails-2d6c4ec731861225779f3106f038effb17a27b21.tar.bz2
rails-2d6c4ec731861225779f3106f038effb17a27b21.zip
`assert_template` fails with empty string.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/test_case.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index fd3a261a72..586dd3cdf9 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -94,14 +94,10 @@ module ActionController
matches_template =
case options
when String
- if options.empty?
- rendered.blank?
- else
- rendered.any? do |t, num|
- options_splited = options.split(File::SEPARATOR)
- t_splited = t.split(File::SEPARATOR)
- t_splited.last(options_splited.size) == options_splited
- end
+ !options.empty? && rendered.any? do |t, num|
+ options_splited = options.split(File::SEPARATOR)
+ t_splited = t.split(File::SEPARATOR)
+ t_splited.last(options_splited.size) == options_splited
end
when Regexp
rendered.any? { |t,num| t.match(options) }