#131 ✓resolved
Shane Mingins

RequestLifecycle#included fails on anonymous subclasses

Reported by Shane Mingins | July 19th, 2010 @ 01:41 AM

I found this problem using sunspot_rails 1.1.0 and rspec-rails 1.3.2 with the code committed:


RSpec::Rails currently uses anonymous subclasses. This code:

loaded_controllers =

        [base].concat(base.subclasses.map { |subclass| subclass.constantize })

fails attempting to get a constant for any anonymous subclass as it already the class. Wondering if it's possible to perhaps test for these?

>> c = Class.new(ActionController::Base)
=> #<Class:0x1030fe610>
>> ActionController::Base.subclasses
=> ["ApplicationController", "#<Class:0x1030fe610>", "#<Class:0x10310c710>", "ActionView::TestCase::TestController", "#<Class:0x103581840>", "Spec::Rails::Example::ViewExampleGroupController", "Spec::Rails::Example::HelperExampleGroupController"]
>> c.superclass
=> ActionController::Base
>> c.after_filter
=> []

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Awesome Solr interaction for Ruby

People watching this ticket

Referenced by