Skip to content
Browse files

revert changes that broke controller specs

  • Loading branch information...
1 parent d38e51f commit 883fe010c71edd43cb0af316ff228267981e0560 @dchelimsky dchelimsky committed Nov 22, 2010
Showing with 10 additions and 6 deletions.
  1. +10 −6 lib/rspec/rails/example/controller_example_group.rb
View
16 lib/rspec/rails/example/controller_example_group.rb
@@ -140,6 +140,15 @@ 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
@@ -150,13 +159,8 @@ 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

0 comments on commit 883fe01

Please sign in to comment.
Something went wrong with that request. Please try again.