Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix render_views for anonymous controllers on 1.8.7. Closes #525

  • Loading branch information...
commit 10bba448dbf46d5d3b62d078a8beb9ab727a8b0b 1 parent 3562f8f
@justinko justinko authored
View
1  Changelog.md
@@ -4,6 +4,7 @@
Bug fixes
* `render_views` called in a spec can now override the config setting. (martinsvalin)
+* Fix render_views for anonymous controllers on 1.8.7. (hudge, mudge)
### 2.9.0 / 2012-03-17
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.1...v2.9.0)
View
6 lib/rspec/rails/example/controller_example_group.rb
@@ -58,10 +58,10 @@ def controller(base_class = nil, &body)
controller_class :
ApplicationController
- metadata[:example_group][:described_class] = Class.new(base_class, &body)
- metadata[:example_group][:described_class].singleton_class.class_eval do
- def name; "AnonymousController" end
+ metadata[:example_group][:described_class] = Class.new(base_class) do
+ def self.name; "AnonymousController"; end
end
+ metadata[:example_group][:described_class].class_eval(&body)
before do
@orig_routes, @routes = @routes, ActionDispatch::Routing::RouteSet.new
Please sign in to comment.
Something went wrong with that request. Please try again.