Permalink
Browse files

Merge branch 'anonymous_controller_route_helpers'

  • Loading branch information...
2 parents cff0228 + b731d91 commit 1c2461df0f0d888596a4e82575e04279687351f8 @alindeman alindeman committed Jan 4, 2014
Showing with 5 additions and 6 deletions.
  1. +2 −3 lib/rspec/rails/example/controller_example_group.rb
  2. +3 −3 spec/spec_helper.rb
@@ -68,9 +68,8 @@ def self.name
end
metadata[:example_group][:described_class].class_eval(&body)
- orig_routes = nil
before do
- orig_routes = self.routes
+ @orig_routes = self.routes
resource_name = @controller.respond_to?(:controller_name) ?
@controller.controller_name.to_sym : :anonymous
self.routes = ActionDispatch::Routing::RouteSet.new.tap { |r|
@@ -79,7 +78,7 @@ def self.name
end
after do
- self.routes = orig_routes
+ self.routes = @orig_routes
@orig_routes = nil
end
end
View
@@ -19,16 +19,16 @@ def self.run_all(reporter=nil)
end
RSpec.configure do |config|
- real_world = nil
-
config.filter_run :focus
config.run_all_when_everything_filtered = true
+ config.order = :random
+
+ real_world = nil
config.before(:each) do
real_world = RSpec.world
RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
end
config.after(:each) do
RSpec.instance_variable_set(:@world, real_world)
end
- config.order = :random
end

0 comments on commit 1c2461d

Please sign in to comment.