Missing host to link to! Please provide :host parameter or set default_url_options[:host] (ActionView::Template::Error)

前端 未结 2 1505
梦毁少年i
梦毁少年i 2021-01-03 23:45

I installed devise and added config.action_mailer.default_url_options = { :host => \'localhost:3000\' } to my development.rb file as suggested. When I run cu

相关标签:
2条回答
  • 2021-01-04 00:40

    Cucumber runs your test environment so you need to add the very same line in test.rb.

    0 讨论(0)
  • 2021-01-04 00:43

    For posterity, in case it has nothing to do with mailers but you still get the Missing host error while running capybara, rspec...

    If you are using url helpers in your tests and have included somewhere in your rspec config:

    config.include Rails.application.routes.url_helpers
    

    Then, you should also add something along this line to the same config:

    Rails.application.routes.default_url_options[:host] = "test.host"
    
    0 讨论(0)
提交回复
热议问题