aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-13 13:26:48 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-13 13:26:48 -0500
commite0fef66149092dd3d2988fff64f0ce8765735687 (patch)
tree76b20ee8e265f74610eb2836be5bc27c300da2a4 /actionpack/lib/action_controller
parent99cc85bc099a757cdd44e4f5f1be4972ab124e0d (diff)
downloadrails-e0fef66149092dd3d2988fff64f0ce8765735687.tar.gz
rails-e0fef66149092dd3d2988fff64f0ce8765735687.tar.bz2
rails-e0fef66149092dd3d2988fff64f0ce8765735687.zip
Made ActionView::Base#first_render a little more private. And added _last_render to track the most recent render. Will fix #609 as a side effect. [#609 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/assertions/response_assertions.rb4
-rw-r--r--actionpack/lib/action_controller/test_process.rb15
2 files changed, 6 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb
index cb36405700..a98c70d66f 100644
--- a/actionpack/lib/action_controller/assertions/response_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -87,11 +87,11 @@ module ActionController
#
def assert_template(expected = nil, message=nil)
clean_backtrace do
- rendered = expected ? @response.rendered_file(!expected.include?('/')) : @response.rendered_file
+ rendered = @response.rendered_template.to_s
msg = build_message(message, "expecting <?> but rendering with <?>", expected, rendered)
assert_block(msg) do
if expected.nil?
- !@response.rendered_with_file?
+ @response.rendered_template ? true : false
else
rendered.match(expected)
end
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index 52884a93f4..a6e0c98936 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -205,17 +205,10 @@ module ActionController #:nodoc:
p.match(redirect_url) != nil
end
- # Returns the template path of the file which was used to
- # render this response (or nil)
- def rendered_file(with_controller = false)
- if template.first_render
- template.first_render.to_s
- end
- end
-
- # Was this template rendered by a file?
- def rendered_with_file?
- !rendered_file.nil?
+ # Returns the template of the file which was used to
+ # render this response (or nil)
+ def rendered_template
+ template._first_render
end
# A shortcut to the flash. Returns an empyt hash if no session flash exists.