Assert_no_template

I was wondering if we have something like assert_no_template as the opposite of assert_template .

What I'm trying to check is that a particular template is not used in the actual render.

+4
source share
3 answers

I put this in my test_helper.rb :

  def assert_template_not_used(template, msg = nil) assert !@templates.any ? {|t, num| t.match(template)}, msg end 
+4
source

It is best to use the argument count: assert_template:

 assert_template :partial => 'YOUR_PARTIAL', :count => 0 
+7
source

Not that I knew. What needs to be done instead? You could potentially claim this content.

0
source

Source: https://habr.com/ru/post/1339376/


All Articles