aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-08-14 08:38:35 +0200
committerYves Senn <yves.senn@gmail.com>2014-08-14 08:38:35 +0200
commit9c91c168abeaacc3fc813d1f60b86d615560e266 (patch)
tree77a1cecb9261643b7936464b5d7e37da61a88449 /actionpack/lib
parent43ce6e22b19245318ff154f859c82272130ac238 (diff)
parentb1ba333ea72b8aa8fc5ffeda4067c128afb026e4 (diff)
downloadrails-9c91c168abeaacc3fc813d1f60b86d615560e266.tar.gz
rails-9c91c168abeaacc3fc813d1f60b86d615560e266.tar.bz2
rails-9c91c168abeaacc3fc813d1f60b86d615560e266.zip
Merge pull request #16027 from tgxworld/template_assertions
Fixes to ActionController::TemplateAssertions
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/test_case.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index eb5d824cbc..152420a54c 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -91,6 +91,13 @@ module ActionController
# # assert that no partials were rendered
# assert_template partial: false
#
+ # # assert that a file was rendered
+ # assert_template file: "README.rdoc"
+ #
+ # # assert that no file was rendered
+ # assert_template file: nil
+ # assert_template file: false
+ #
# In a view test case, you can also assert that specific locals are passed
# to partials:
#
@@ -140,6 +147,8 @@ module ActionController
if options[:file]
assert_includes @_files.keys, options[:file]
+ elsif options.key?(:file)
+ assert @_files.blank?, "expected no files but #{@_files.keys} was rendered"
end
if expected_partial = options[:partial]