Why does the test environment need default_url_options be set for ActionMailer?
If I don't set it, I'm getting this when executing my specs:
ActionView::Template::Error:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
I'm especially wondering because when setting
config.action_mailer.default_url_options = {host: 'localhost:3000'}
then in theory links in emails will lead to localhost:3000, which as far as I know is not where the test server instance really is running? Still, when using email_spec
gem and clicking on links in emails, they work, because the gem removes the server name and port, so a link typically looks like this:
/en/user/confirmation?confirmation_token=QZu3tw17uozhpEfuVWzF
So one more time: what do I need to specify the host for if it's removed by email_spec
gem anyway?