Last active
June 4, 2018 14:03
-
-
Save vmcilwain/969b1c67c610f1967d25d1b44a6d2564 to your computer and use it in GitHub Desktop.
Rails 4.2.0 Engine RSpec main app routing
This file contains hidden or 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/main_app.rb | |
module MainAppRoute | |
def main_app | |
Rails.application.class.routes.url_helpers | |
end | |
end | |
# In spec/rails_helper | |
RSpec.config do |config| | |
config.include MainAppRoute | |
end | |
# Then in the controller specs | |
it 'redirects to main_app.root_path' do | |
expect(response).to redirect_to main_app.root_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment