Created
February 20, 2010 13:40
-
-
Save kristianmandrup/309684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara is very framework agnostic, it's all built on pure Rack. Check out this file, which contains all the rails specific code in Capybara: | |
http://github.com/jnicklas/capybara/blob/master/lib/capybara/rails.rb | |
As you can see, it's not a lot. Some changes would be necessary to that file for Rails 3 support, I think, since the Rack app for Rails has changed. | |
/jonasn | |
-- | |
Looking at http://github.com/rails/rails/blob/master/railties/lib/rails/rack/static.rb | |
------------ | |
require 'action_dispatch' | |
module Rails::Rack | |
Static = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Rails::Rack::Static', ActionDispatch::Static) | |
end | |
------------ | |
and http://github.com/rails/rails/blob/master/railties/lib/rails/rack.rb | |
------------ | |
module Rails::Rack | |
Static = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Rails::Rack::Static', ActionDispatch::Static) | |
end | |
------------ | |
Static is autoloaded. There is no Rack::Builder it seems. Static creates the Rack app I guess? | |
My guess for use with Rails 3 rack, something like: | |
------------ | |
require 'capybara' | |
require 'capybara/dsl' | |
use Rails::Rack | |
Capybara.app = Rails::Rack::Static do | |
map "/" do | |
run ActionController::Dispatcher.new | |
end | |
end.to_app | |
Capybara.asset_root = Rails.root.join('public') | |
Suggestions are welcome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment