I can't seem to use ERBUtils methods like h or html_escape inside my helper specs.
helper.link_to_custom("<b>hello</b>").should == link_to(html_escape("<b>hello</b>"))
This will raise undefined method for html_escape.
RSpec's helper specs wrap Rails' helper tests. This would make more sense to fix there, so please submit this to the Rails issue tracker.
FYI if you do - Rails' helper specs work a bit differently - instead of exposing a helper object, they include the helper module right in the test so your example would look like this:
assert_equal link_to(html_escape("<b>hello</b>")), link_to_custom("<b>hello</b>")
Hey David, rails doesn't include it into TestCase--as for the reason, I'm not really clear. And I'm not sure if they even consider it a bug.
In any case, now that I think about it, perhaps rspec should fix this "issue.". Rspec takes the extra mile and does the right thing by giving you a helper method that encapsulates the helper scope. To the rspec user, there's no knowledge that the helper inherits from rails TestCase, and they shouldn't. Rspec-rails promises the entire helper context inside helper and it should fix what rails TestCase lacks.
Just my opinion. Thanks!