rspec/rspec-rails — pull request #584 by moonmaster9000 (2012-07-31 18:53:46+00:00)
Title: optionally specify a controller name

Needed to test a module that gets included into controllers and does interesting things based on the name of the controller. Thus, needed a way to name the anonymous controller.

```cucumber
Scenario: override anonymous controller name
Given a file named "spec/controllers/override_anonymous_controller_name_spec.rb" with:
"""
require "spec_helper"

class ApplicationController < ActionController::Base; end
class ApplicationControllerSubclass < ActionController::Base; end

describe ApplicationController do
controller(ApplicationControllerSubclass, "MyAnonymousController") {}

specify { controller.class.name.should == "MyAnonymousController" }
end
"""
When I run `rspec spec`
Then the examples should all pass
```