1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Move the RackTest driver override to capybara/rails

This change enables the `:respect_data_method` option from the RackTest
driver for Rails projects that don't use RSpec.
This commit is contained in:
Carlos Antonio da Silva 2012-11-15 11:18:14 -02:00
parent 6446eac5a3
commit 9c1dd623f1
3 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,11 @@
# master
### Changed
* Move the RackTest driver override with the `:respect_data_method` option
enabled from capybara/rspec to capybara/rails, so that it is enabled in
Rails projects that don't use RSpec. [Carlos Antonio da Silva]
# Version 2.0.0
Release date: 2012-11-05

View file

@ -4,7 +4,7 @@ require 'capybara/dsl'
Capybara.app = Rack::Builder.new do
map "/" do
if Rails.version.to_f >= 3.0
run Rails.application
run Rails.application
else # Rails 2
use Rails::Rack::Static
run ActionController::Dispatcher.new
@ -15,3 +15,7 @@ end.to_app
Capybara.asset_root = Rails.root.join('public')
Capybara.save_and_open_page_path = Rails.root.join('tmp/capybara')
# Override default rack_test driver to respect data-method attributes.
Capybara.register_driver :rack_test do |app|
Capybara::RackTest::Driver.new(app, :respect_data_method => true)
end

View file

@ -22,8 +22,3 @@ RSpec.configure do |config|
end
end
end
# Override default rack_test driver to respect data-method attributes.
Capybara.register_driver :rack_test do |app|
Capybara::RackTest::Driver.new(app, :respect_data_method => true)
end