diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-31 00:31:47 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-31 00:31:47 -0200 |
commit | d5b275db5c20669a7a9e598a70decf1316b39e03 (patch) | |
tree | a70d4ddd7fbada6ccd8a3ebe117c77c1f17ac245 /actionpack/lib/action_controller | |
parent | 6b7cd20ab39b16cb5111ecca71ffea4fd95a0066 (diff) | |
download | rails-d5b275db5c20669a7a9e598a70decf1316b39e03.tar.gz rails-d5b275db5c20669a7a9e598a70decf1316b39e03.tar.bz2 rails-d5b275db5c20669a7a9e598a70decf1316b39e03.zip |
Revert "Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased"
This reverts commit 7d17cd2cbfc086f5aa9dd636e1207eb130150428.
Conflicts:
actionpack/CHANGELOG.md
Reason: This added a regression since people were relying on this buggy behavior.
This will introduce back #3849 but we will be backward compatible in
stable release.
Fixes #8068.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 37470b8713..b574a36430 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -72,26 +72,19 @@ module ActionController validate_request! case options - when NilClass, Regexp, String, Symbol + when NilClass, String, Symbol options = options.to_s if Symbol === options rendered = @templates msg = build_message(message, "expecting <?> but rendering with <?>", options, rendered.keys.join(', ')) - matches_template = - case options - when String - 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 + assert_block(msg) do + if options rendered.any? { |t,num| t.match(options) } - when NilClass - rendered.blank? + else + @templates.blank? end - assert matches_template, msg + end when Hash if expected_layout = options[:layout] msg = build_message(message, |