Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check for .abstract? controllers in ControllerExampleGroup.

  • Loading branch information...
commit 6be42c4cbfb8253787b89184f6c64735f3217dbd 1 parent 6ee7888
@thomasfedb thomasfedb authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/rspec/rails/example/controller_example_group.rb
View
9 lib/rspec/rails/example/controller_example_group.rb
@@ -60,12 +60,15 @@ def controller(base_class = nil, &body)
end
base_class ||= ApplicationController
- metadata[:example_group][:described_class] = Class.new(base_class) do
+ metadata[:example_group][:described_class] = Class.new(base_class)
+
+ metadata[:example_group][:described_class].class_eval do
def self.name
- superclass == ApplicationController ?
- "AnonymousController" : superclass.to_s
+ superclass == ApplicationController || superclass.abstract? ?
+ "AnonymousController" : superclass.to_s
end
end
+
metadata[:example_group][:described_class].class_eval(&body)
before do
Please sign in to comment.
Something went wrong with that request. Please try again.