Skip to content

Instantly share code, notes, and snippets.

@jacobo
Created January 22, 2018 22:23
Show Gist options
  • Save jacobo/57302aed872c43437477457dbb519f10 to your computer and use it in GitHub Desktop.
Save jacobo/57302aed872c43437477457dbb519f10 to your computer and use it in GitHub Desktop.
module WithControllerHelper
class TestCase < ActionController::TestCase
def initialize(controller_class)
super("WithControllerHelper")
setup_controller_request_and_response
@routes = Rails.application.routes
@controller = controller_class.new
end
end
def with_controller(controller_class)
TestCase.new(controller_class)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment