Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:43:13+00:00 2026-05-26T13:43:13+00:00

My application sends E-mails containing absolute urls. I set host in config/environment/development.rb config.action_mailer.default_url_options =

  • 0

My application sends E-mails containing absolute urls.

I set host in config/environment/development.rb

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

Now I want to test if Email contains valid url. Using regular expression I take out full url from E-mail and want to visit this address using Capybara function.

mail = ActionMailer::Base.deliveries.last
address = mail.body.to_s[%r{http.+/edit}]
visit address;

But I don’t know what host should be set in config/environment/test.rb

When I set localhost:3000 it tries to connect to my local server started by rails server command.

Do you have any ideas to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:43:14+00:00Added an answer on May 26, 2026 at 1:43 pm

    What worked for me:

    Capybara.server_port = 3005
    

    (see https://github.com/vangberg/capybara/commit/5784f03d6aa87e63e759abda794a43738e4f320f)

    and

    config.action_mailer.default_url_options = { :host => 'localhost:3005' }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application sends mails containing an authentication token. The user which receives the mail
Our web application sends e-mails. We have lots of users, and we get lots
We have a web application that periodically sends out e-mails to users. At the
I'm writing an application in classic ASP (yes, please forgive me) that sends e-mails
My application sends notification mails to users so I created a html template for
I need to test that my Django application sends e-mails with correct content. I
Hy, I have an application that sends mails with Gmail SMTP server (smtp.gmail.com) using
My application sends out some emails, and the image paths referenced in the e-mails
I have a PHP application that sends email using the pear Mail function. Unfortunately
I'm writing a WinForms application that sends email messages (like a mail merge). I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.