I'm currently getting the following error:
1) Organization.invite_user should create a new user for a specific orgs initial user
Failure/Error: organization.invite_user(second_email)
ActionView::Template::Error:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
# ./app/views/devise/mailer/reset_password_instructions.html.erb:5:in `_app_views_devise_mailer_reset_password_instructions_html_erb___4480543240081585515_70131221479860'
# ./app/models/organization.rb:34:in `invite_user'
# ./spec/models/organization_spec.rb:24:in `block (3 levels) in <top (required)>'
Anyone know what could be happening here in rspec?
in your config/environments/test.rb file, you should provide the following configuration:
config.action_mailer.default_url_options = { host: 'www.example.com' }
for links to be generated by ActionMailer
The error seems pretty self explanatory: you need to provide more information to your mailer initializer so that it knows how to actually render the links.
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
If you don't do that, the links would have to be relatives, which makes no sense when talking about links in emails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With