ruby on rails - Capybara emails: setting correct port in URLs -



ruby on rails - Capybara emails: setting correct port in URLs -

i'm using capybara (2.4.4) capybara-email (2.4.0) gem in rspec (2.14.1) integration tests rails (4.1.6) app. have test ensures functionality of link in email. while capybara spawns server on different, random ports each test run, rails's path helpers in email views generate localhost:3000 domain specified in config/environments/test.rb.

how can specify rails path helpers utilize current capybara test server's host , port domains?

i solved specifying host (but not port) in test.rb:

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

and including

capybara.always_include_port = true

in env.rb.

ruby-on-rails ruby-on-rails-4 rspec capybara integration-testing

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -