Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure url generation for RSpec and Capybara #70

Open
joshmfrankel opened this issue Oct 10, 2023 · 0 comments
Open

Configure url generation for RSpec and Capybara #70

joshmfrankel opened this issue Oct 10, 2023 · 0 comments

Comments

@joshmfrankel
Copy link
Owner

joshmfrankel commented Oct 10, 2023

# test.rb

Rails.application.configure do
  config.action_mailer.default_url_options = {host: "localhost", port: 3001}

  Rails.application.default_url_options = Rails.application.config.action_mailer.default_url_options
end
# rails_helper.rb

  config.before(:each, type: :system, js: true) do
    driven_by :selenium_chrome_headless

    # Ensure Capybara utilizes correct url for building links
    Rails.application.default_url_options[:host] = Capybara.server_host
    Rails.application.default_url_options[:port] = Capybara.current_session.server.port
  end

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant