Permalink
Browse files

include RailsExampleGroup in spec/features (necessary when there is n…

…o AR)
  • Loading branch information...
1 parent 0dbd908 commit a77de85c81563b222e75d5afcc66eeed37717474 @dchelimsky dchelimsky committed Oct 6, 2012
Showing with 5 additions and 3 deletions.
  1. +0 −2 lib/rspec/rails/fixture_support.rb
  2. +5 −1 lib/rspec/rails/vendor/capybara.rb
@@ -3,7 +3,6 @@ module Rails
if defined?(ActiveRecord::TestFixtures)
module FixtureSupport
extend ActiveSupport::Concern
-
include RSpec::Rails::SetupAndTeardownAdapter
include RSpec::Rails::TestUnitAssertionAdapter
include ActiveRecord::TestFixtures
@@ -37,4 +36,3 @@ module FixtureSupport
end
end
end
-
@@ -27,7 +27,11 @@
}
end
- unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
+ if defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
+ c.include RSpec::Rails::RailsExampleGroup, :example_group => {
+ :file_path => c.escaped_path(%w[spec features])
alindeman
alindeman Oct 6, 2012 Contributor

Should we consider making a FeatureExampleGroup where these includes happen?

dchelimsky
dchelimsky Oct 6, 2012 Owner

I thought about that but this is a capybara-specific feature, and I like keeping all of the capy-specific dependencies in vendor/capybara.rb. Make sense?

+ }
+ else
c.include Capybara, :type => :request
c.include Capybara, :type => :controller
end

0 comments on commit a77de85

Please sign in to comment.