Capybara with subdomains - default_host

后端 未结 5 907
梦毁少年i
梦毁少年i 2020-12-01 03:33

I have an app that uses subdomains to switch databases (multi-tenancy). I\'m trying to use Capybara for integration testing, and it really relies a lot on subdomains.

5条回答
  •  暖寄归人
    2020-12-01 03:53

    This guy has the right answer here:

    http://zurb.com/forrst/posts/Testing_Subdomains_in_Capybara-g4M

    You want to do

    Capybara.current_session.driver.reset!
    Capybara.default_host = 'http://app.mydomain.com'
    

提交回复
热议问题