# RSpec with devise test helpers

**URL:** <https://www.ruby-forum.com/t/rspec-with-devise-test-helpers/236982>\
**Category:** RSpec\
**Created:** [October 16, 2013, 9:17pm UTC](https://www.ruby-forum.com/t/rspec-with-devise-test-helpers/236982 "2013-10-16T21:17:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [October 16, 2013, 9:17pm UTC](https://www.ruby-forum.com/t/rspec-with-devise-test-helpers/236982/1 "2013-10-16T21:17:24Z")

</div>

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/removed\_email\_address@domain.invalid/gems/devise-3.0.0/lib/devise/test\_helpers.rb:31:in  
`merge!' # /Users/phendrick/.rvm/gems/removed_email_address@domain.invalid/gems/devise-3.0.0/lib/devise/test_helpers.rb:31:in`block in warden’  
#  
/Users/phendrick/.rvm/gems/removed\_email\_address@domain.invalid/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.
