Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need to require RSpec::Matchers now that it's managed by

RSpec.configuration
  • Loading branch information...
commit 2233e5af1bbc80dbf74aea5368599336ea9bb17d 1 parent 14f0f4e
@dchelimsky dchelimsky authored
View
25 lib/rspec/rails/example/controller_example_group.rb
@@ -84,21 +84,14 @@ module ControllerExampleGroup
include RSpec::Rails::BrowserSimulators
webrat do
- include Webrat::Methods
include Webrat::Matchers
+ include Webrat::Methods
end
capybara do
include Capybara
end
- # TODO (DC 7/31/2010) this is already included in RailsExampleGroup, but
- # due to some load order dependency problem between Webrat::Matchers and
- # RSpec::Matchers, combined with the fact that RailsExampleGroup extends
- # ActiveSupport::Concern, while the matcher modules do not, this needs to
- # be here as well. At least for now.
- include RSpec::Matchers
-
module ClassMethods
def controller_class
describes
@@ -147,15 +140,6 @@ def name
"StubResourcesController"
end
end
-
- before do
- @orig_routes, @routes = @routes, ActionDispatch::Routing::RouteSet.new
- @routes.draw { resources :stub_resources }
- end
-
- after do
- @routes = @orig_routes
- end
end
end
@@ -166,8 +150,13 @@ module InstanceMethods
included do
metadata[:type] = :controller
before do
- @routes = ::Rails.application.routes
ActionController::Base.allow_forgery_protection = false
+ @orig_routes, @routes = ::Rails.application.routes, ActionDispatch::Routing::RouteSet.new
+ @routes.draw { resources :stub_resources }
+ end
+
+ after do
+ @routes = @orig_routes
end
subject { controller }
end
View
1  lib/rspec/rails/example/rails_example_group.rb
@@ -5,7 +5,6 @@ module RailsExampleGroup
include RSpec::Rails::SetupAndTeardownAdapter
include RSpec::Rails::TestUnitAssertionAdapter
- include RSpec::Matchers
end
end
end
View
20 lib/rspec/rails/example/request_example_group.rb
@@ -24,6 +24,10 @@ module RequestExampleGroup
webrat do
include Webrat::Matchers
include Webrat::Methods
+
+ def app
+ ::Rails.application
+ end
end
capybara do
@@ -34,28 +38,12 @@ module RequestExampleGroup
include RSpec::Rails::Matchers::RenderTemplate
include ActionController::TemplateAssertions
- module InstanceMethods
- def app
- ::Rails.application
- end
-
- def last_response
- response
- end
- end
-
included do
metadata[:type] = :request
before do
@router = ::Rails.application.routes
end
-
- webrat do
- Webrat.configure do |config|
- config.mode = :rack
- end
- end
end
RSpec.configure &include_self_when_dir_matches('spec','requests')
Please sign in to comment.
Something went wrong with that request. Please try again.