Last Updated: February 25, 2016
·
1.24K
· idrozd

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)

1 Response
Add your response

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 ·