jonleighton/focused_controller — pull request #30 by timcowlishaw (2013-06-20 16:15:50+00:00)
Title: Allow default rails interface in functional tests of controllers

Hi Jon!

Thanks a lot for focused_controller - it's tidied up the controller layer of the app I'm working on at the moment no end!

This patch is a very small proposal regarding the functional testing helpers. In my app, all but one of my controllers use focused controller, so therefore I thought I'd include the helpers in all my controller specs using the rspec config:

config.include FocusedController::RSpecFunctionalHelpers, :type => :controller

However, I have one controller that's un-focused (as it needs to override some behaviour in Devise), and sadly this breaks my vanilla rails controller specs for that.

This patch adapts the functional test helpers to allow them to be called with an action name optionally, (as in the default rails implementation), defaulting to the FocusedController action name if none is supplied, therefore ensuring that including the functional helpers doesn't break existing rails controller specs.

Thanks!

Tim