in rspec-1 view specs i had the ability to say:
which made some helper methods like
that where used in views and controllers return something valuable.
Implementation was based on the fact that the controller in rspec-1
was ApplicationController. My ApplicationController contained a method
for setting the current_account.
In Rspec2 this is broken as the controller in ViewExampleGroup is now
Would anyone know of an elegant way to add functionality, like helper
methods, to this controller instance in all ViewExampleGroups only.
option 1, which i don’t like because it depends on the fact that
ViewExampleGroup uses ActionView::TestCase::TestController:
def login_as account
controller.current_account = account
I would like to use some hook to add these methods only to the
controller instance used in the view specs, regardless of what class
There must be an elegant way, is there?