aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/testing
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-23 15:58:38 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 11:49:11 -0700
commitcecafc52ee0a4a53c903ddbaba95683261f88e5f (patch)
tree4cc1f0d246a313b2a2fa78747b3265bdbd901c22 /actionpack/lib/action_controller/testing
parentda3c21ead59cb47b8f4c69c6bd95f225a9c8b479 (diff)
downloadrails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.gz
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.bz2
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.zip
Refactor ActionView::Template
ActionView::Template is now completely independent from template storage, which allows different back ends such as the database. ActionView::Template's only responsibility is to take in the template source (passed in from ActionView::Path), compile it, and render it.
Diffstat (limited to 'actionpack/lib/action_controller/testing')
-rw-r--r--actionpack/lib/action_controller/testing/assertions/response.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/testing/assertions/response.rb b/actionpack/lib/action_controller/testing/assertions/response.rb
index c57cbecc44..574b8d6825 100644
--- a/actionpack/lib/action_controller/testing/assertions/response.rb
+++ b/actionpack/lib/action_controller/testing/assertions/response.rb
@@ -98,22 +98,22 @@ module ActionController
clean_backtrace do
case options
when NilClass, String
- rendered = @controller.response.rendered[:template].to_s
+ rendered = (@controller.response.rendered[:template] || []).map { |t| t.identifier }
msg = build_message(message,
"expecting <?> but rendering with <?>",
- options, rendered)
+ options, rendered.join(', '))
assert_block(msg) do
if options.nil?
@controller.response.rendered[:template].blank?
else
- rendered.to_s.match(options)
+ rendered.any? { |t| t.match(options) }
end
end
when Hash
if expected_partial = options[:partial]
partials = @controller.response.rendered[:partials]
if expected_count = options[:count]
- found = partials.detect { |p, _| p.to_s.match(expected_partial) }
+ found = partials.detect { |p, _| p.identifier.match(expected_partial) }
actual_count = found.nil? ? 0 : found.second
msg = build_message(message,
"expecting ? to be rendered ? time(s) but rendered ? time(s)",
@@ -123,7 +123,7 @@ module ActionController
msg = build_message(message,
"expecting partial <?> but action rendered <?>",
options[:partial], partials.keys)
- assert(partials.keys.any? { |p| p.to_s.match(expected_partial) }, msg)
+ assert(partials.keys.any? { |p| p.identifier.match(expected_partial) }, msg)
end
else
assert @controller.response.rendered[:partials].empty?,