Last active
December 30, 2016 07:16
-
-
Save mhuggins/d91a752684e552c05321 to your computer and use it in GitHub Desktop.
Fix ActionController::UrlGenerationError for controller tests in Rails engines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/support/helpers/controller_helpers.rb | |
module ControllerHelpers | |
extend ActiveSupport::Concern | |
included do | |
routes { ProfileApi::Engine.routes } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/rails_helper.rb | |
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |f| require f } | |
RSpec.configure do |config| | |
config.include ControllerHelpers, type: :controller | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment