diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-17 14:19:42 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-17 14:29:18 -0700 |
commit | 947f86c699b33bd44703b3554db58e4cfca37c86 (patch) | |
tree | 8029a2acf7180b2724830e2727c37252872e436e /actionpack/test | |
parent | 13a783672aad338b9c7ade5319ec7967768905d7 (diff) | |
download | rails-947f86c699b33bd44703b3554db58e4cfca37c86.tar.gz rails-947f86c699b33bd44703b3554db58e4cfca37c86.tar.bz2 rails-947f86c699b33bd44703b3554db58e4cfca37c86.zip |
Modify assert_template to use instrumentation
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 67aa412d3d..a3486aa039 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -239,47 +239,6 @@ module ActionController setup do @router = SharedTestRoutes end - - def assert_template(options = {}, message = nil) - validate_request! - - hax = @controller.view_context.instance_variable_get(:@_rendered) - - case options - when NilClass, String - rendered = (hax[:template] || []).map { |t| t.identifier } - msg = build_message(message, - "expecting <?> but rendering with <?>", - options, rendered.join(', ')) - assert_block(msg) do - if options.nil? - hax[:template].blank? - else - rendered.any? { |t| t.match(options) } - end - end - when Hash - if expected_partial = options[:partial] - partials = hax[:partials] - if expected_count = options[:count] - found = partials.detect { |p, _| p.identifier.match(expected_partial) } - actual_count = found.nil? ? 0 : found[1] - msg = build_message(message, - "expecting ? to be rendered ? time(s) but rendered ? time(s)", - expected_partial, expected_count, actual_count) - assert(actual_count == expected_count.to_i, msg) - else - msg = build_message(message, - "expecting partial <?> but action rendered <?>", - options[:partial], partials.keys) - assert(partials.keys.any? { |p| p.identifier.match(expected_partial) }, msg) - end - else - assert hax[:partials].empty?, - "Expected no partials to be rendered" - end - end - end end end |