Rails 5 and Devise::Test::IntegrationHelpers not working

566 views
Skip to first unread message

Jez Caudle

unread,
May 18, 2016, 5:02:38 AM5/18/16
to Devise
Hello,

this very morning I upgraded to Devise 4.1.1 so I could use the new sign_in method in Rails 5.

I've noticed a typo in the readme.md - there is a stray "ruby" in there when explaining "include Devise::Test::IntegrationHelpers".

My problem though is that when I try and run my integration tests with "include Devise::Test::IntegrationHelpers" placed as per the docs I get the following error:

/deviseworking/test/integration/adminflow_test.rb:4:in `<class:AdminflowTest>': uninitialized constant Devise::Test (NameError)


You can have a look at:


https://github.com/jezcaudle/devise-example



This is what I did:


Bundler version 1.11.2

ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]


Rails 5.0.0.beta4

Devise 4.1.1


warden 1.2.6


orm_adapter 0.5.0



rails new deviseworking


cd deviseworking/


Add to Gem file:


gem ‘devise'


bundle


installs devise 4.1.1


rails generate devise:install


Add:


config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }


to both development.rb and test.rb


To routes.rb add:


root to: "home#index”

resources :tworks



rails generate devise

rake db:migrate

rails generate scaffold twork name:string address:string

rake db:migrate


Delete everything in test/fixtures/users.yml and paste in:

admin:

    id: 1

    email: "j...@example.ltd.uk"

    encrypted_password: "$2a$04$ksQH6hvij.p0ty2Syd/D.OTf.Vp8fg7Le.QPHyrbUDY3klr8Kwnia"

    reset_password_token: <%= nil %>

    reset_password_sent_at: <%= nil %>

    remember_created_at: <%= nil %>

    sign_in_count: 1

    current_sign_in_at: "2012-11-16 11:49:14"

    last_sign_in_at: "2012-11-16 11:49:14"

    current_sign_in_ip: "127.0.0.1"

    last_sign_in_ip: “127.0.0.1"


Fix incorrect indentation while swearing a lot.


Do:


rails g integration_test adminflow


Edit the integration test and below the class line add:


include Devise::Test::IntegrationHelpers


Run the test:


rails test test/integration/adminflow_test.rb


Get an error:



/deviseworking/test/integration/adminflow_test.rb:4:in `<class:AdminflowTest>': uninitialized constant Devise::Test (NameError)

Lucas Mazza

unread,
May 18, 2016, 8:40:01 AM5/18/16
to plataforma...@googlegroups.com
Devise::Test::IntegrationHelpers is only available on the master branch and hasn't been released yet.

--

---
You received this message because you are subscribed to the Google Groups "Devise" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jez Caudle

unread,
May 19, 2016, 5:07:36 AM5/19/16
to Devise
Okay. Thanks for the reply. I'll grab master from GitHub.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-devise+unsub...@googlegroups.com.

Ilia Lobsanov

unread,
Jun 21, 2016, 1:59:19 PM6/21/16
to Devise
Any idea when the next release will be out?
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-devise+unsub...@googlegroups.com.

Lucas Mazza

unread,
Jun 23, 2016, 9:52:56 AM6/23/16
to plataforma...@googlegroups.com
I'm going to take a few days on early june to do a decent pass of the existing PRs and issues to see if we can ship some extra goodies with Devise 4.2.

To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "Devise" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages