Search code examples
ruby-on-railsfunctional-testing

assert_no_template


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

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


Solution

  • I put this in my test_helper.rb:

      def assert_template_not_used(template, msg = nil)
        assert [email protected]? {|t, num| t.match(template)}, msg
      end