[rspec-users] RSpec with devise test helpers

Zach Dennis zach.dennis at gmail.com
Tue Oct 22 15:52:26 UTC 2013


Can you provide a gist of your spec helper, controller spec, and controller
implementation?


On Wed, Oct 16, 2013 at 3:17 PM, Paul Ols <lists at ruby-forum.com> wrote:

> I've set my Rails (engine) project to include devise and other tools
> like FactoryGirl.
> I'd like to write some tests with contexts around anon/authenticated
> users.
>
> In my spec_helper.rb's RSpec.configure block, I have this:
>
> config.include Devise::TestHelpers, type: :controller
>
> Which gives me this, when running rspec:
>
>   1) PropertiesController GET 'index' returns http success
>      Failure/Error: Unable to find matching line from backtrace
>      TypeError:
>        no implicit conversion of nil into Hash
>      #
> /Users/phendrick/.rvm/gems/ruby-2.0.0-p0 at hendrickdev.brightnest
> /gems/devise-3.0.0/lib/devise/test_helpers.rb:31:in
> `merge!'
>      #
> /Users/phendrick/.rvm/gems/ruby-2.0.0-p0 at hendrickdev.brightnest
> /gems/devise-3.0.0/lib/devise/test_helpers.rb:31:in
> `block in warden'
>      #
> /Users/phendrick/.rvm/gems/ruby-2.0.0-p0 at hendrickdev.brightnest
> /gems/warden-1.2.3/lib/warden/manager.rb:23:in
> `initialize'
> ...
>
> Without the TestHelpers module included, the specs run (obviously none
> of them have devise logic in them just yet).
>
> Any ideas what's causing this error and how I can resolve it?
>
> thanks.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
@zachdennis
http://www.continuousthinking.com
http://www.mutuallyhuman.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20131022/1b180eca/attachment.html>


More information about the rspec-users mailing list