rivdew
Last Updated: February 25, 2016
·
1.048K
· idrozd
6b67518d6700874714698702879014a2

Testing subdirectory rails app with capybara

This is from my experience with rails 3.1 / Capybara 2.03, but maybe someone will find this handy:

Capybara ignores config,ru, thus any mapping you configured there will be lost for tests, and you'll be receiving routing errors

Solution:

#spec_helper
Capybara.app = Rack::UrlMap.new('/subfolder' => Rails.application)
Say Thanks
Respond

1 Response
Add your response

10683
5744235abab8e6c1c6c6034874392d5a

minor typo that might trip people up

Capybara.app = Rack::URLMap.new('/subfolder' => Rails.application)

FYI URLMap is part of rack

over 1 year ago ·