Permalink
Browse files

Merge pull request #868 from carlosantoniodasilva/rails-respect-data-…

…method

Move the RackTest driver override to capybara/rails
  • Loading branch information...
2 parents 7d4dfad + 9c1dd62 commit 5e7287162faf23846d40c406d4cb843759cd373e @elabs-dev elabs-dev committed Nov 15, 2012
Showing with 13 additions and 6 deletions.
  1. +8 −0 History.md
  2. +5 −1 lib/capybara/rails.rb
  3. +0 −5 lib/capybara/rspec.rb
View
@@ -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
@@ -4,7 +4,7 @@
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 @@
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
@@ -22,8 +22,3 @@
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

0 comments on commit 5e72871

Please sign in to comment.