Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Capybara integration to support 0.4 and 1.0

- this adds capybara matchers to view and helper specs
- Closes #302.
  • Loading branch information...
commit 59793dcc349b64f4ebcf742606371001256c774d 1 parent 5dcdc62
@dchelimsky dchelimsky authored
View
1  features/Changelog.md
@@ -7,6 +7,7 @@
* Add documentation to the generated spec
* Use any_instance to avoid stubbing finders
* Use real objects instead of mock_model
+ * Update capybara integration to work with capy 0.4 and 1.0.0.beta
### 2.6.0.rc2 / 2011-04-18
View
5 gemfiles/base.rb
@@ -19,7 +19,10 @@ def self.extended(host)
gem "aruba", "~> 0.3.6"
gem "growl", "1.0.3"
gem "ZenTest", "~> 4.4.2"
- gem "webrat", "0.7.2"
+
+ # gem "webrat", "0.7.2"
+ # gem "capybara", "~> 0.4"
+ # gem "capybara", "1.0.0.beta1"
unless ENV['CI']
gem "rcov", "0.9.9"
View
5 lib/rspec/rails/browser_simulators.rb
@@ -1,4 +1,9 @@
begin
+ require 'capybara/rspec'
+rescue LoadError
+end
+
+begin
require 'capybara/rails'
rescue LoadError
end
View
7 lib/rspec/rails/example/controller_example_group.rb
@@ -90,7 +90,12 @@ module ControllerExampleGroup
end
capybara do
- include Capybara
+ begin
+ include Capybara::DSL
+ include Capybara::RSpecMatchers
+ rescue
+ include Capybara
+ end
end
module ClassMethods
View
4 lib/rspec/rails/example/helper_example_group.rb
@@ -36,6 +36,10 @@ module HelperExampleGroup
include Webrat::Matchers
end
+ capybara do
+ include Capybara::RSpecMatchers if defined?(Capybara::RSpecMatchers)
+ end
+
module ClassMethods
def determine_default_helper_class(ignore)
describes
View
6 lib/rspec/rails/example/mailer_example_group.rb
@@ -11,7 +11,11 @@ module MailerExampleGroup
end
capybara do
- include Capybara
+ begin
+ include Capybara::RSpecMatchers
+ rescue
+ include Capybara
+ end
end
included do
View
2  lib/rspec/rails/example/request_example_group.rb
@@ -37,7 +37,7 @@ def last_response
end
capybara do
- include Capybara
+ include Capybara unless defined?(Capybara::DSL)
end
include RSpec::Rails::Matchers::RedirectTo
View
4 lib/rspec/rails/example/view_example_group.rb
@@ -29,6 +29,10 @@ module ViewExampleGroup
include Webrat::Matchers
end
+ capybara do
+ include Capybara::RSpecMatchers if defined?(Capybara::RSpecMatchers)
+ end
+
module ClassMethods
def _default_helper
base = metadata[:example_group][:description].split('/').first
Please sign in to comment.
Something went wrong with that request. Please try again.