Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

assert_template :symbol passes whatever

#2011

When you use a symbol for assert_template, it passes regardless of what symbol you pass.

For example, if the actual template rendered is 'foo/new.html.erb', then the following will happen:

  • assert_template 'new' -> pass
  • assert_template :new -> pass
  • assert_template 'newbar' -> fail
  • assert_template :newbar -> pass

Is this intended behaviour, or a bug?

Thanks,

~ Mark

Reported by Mark Dodwell · February 18th, 2009 @ 09:36 PM

State: resolved
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Mike Breen
    Mike Breen
    • Tag changed from 2.3-rc1, assert_template, testunit to 2.3-rc1, assert_template, patch, testunit

    The attached patch adds:

    • basic tests for existing assert_template functionality
    • assert_template can now accept a Symbol argument
    • assert_template raises an ArgumentError if passed something other than String, Nil, Symbol or Hash

    March 16th, 2009 @ 01:11 AM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to open
    • Assigned user set to Pratik

    Patch + tests work fine for me on edge. +1

    March 16th, 2009 @ 01:37 AM

  3. Pratik
    Pratik
    • Should use get instead of process
    • Should rebase all the commits into a single commit

    Thanks

    March 16th, 2009 @ 01:41 AM

  4. Mike Breen
    Mike Breen
    • Assigned user cleared.

    I've updated the patch to use get instead of process and put it into a single commit.

    March 16th, 2009 @ 11:24 AM

  5. Mike Breen
    Mike Breen
    • Assigned user set to Pratik

    March 16th, 2009 @ 11:26 AM

  6. Repository