开发者

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

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

Missing host to link to! Please provide :host parameter or set default_url_options[:ho开发者_Python百科st] (ActionView::Template::Error)

does anyone know what this is related to? not too much info on google about this


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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜