[rspec-users] Rspec + Devise + BaseController

David Chelimsky dchelimsky at gmail.com
Wed Mar 20 19:50:49 UTC 2013


On Wed, Mar 20, 2013 at 11:21 AM, Ezequiel Delpero <lists at ruby-forum.com> wrote:
> Finally I could solve the problem. The problem was on the definition of
> the anonymous controller on the spec:
>
> instead of:
>
>     controller do
>       def index
>       end
>     end
>
> I used:
>
>     controller(Admins::Base) do
>       def index
>       end
>     end
>
> You need to specify always the anonymous controller you're testing
> unless is ApplicationController the one you're trying to test.

FYI - docs: http://rubydoc.info/gems/rspec-rails/RSpec/Rails/ControllerExampleGroup/ClassMethods#controller-instance_method


More information about the rspec-users mailing list