Devise: undefined method `rails5?' for Devise::Test:Module in 4.4.2

Created on 15 Mar 2018  路  15Comments  路  Source: heartcombo/devise

Environment

  • Ruby 2.3.5
  • Rails 5.1.5
  • Devise 4.4.2

Current behavior

Controller specs where the user is not authenticated fail with this exception:

undefined method `rails5?' for Devise::Test:Module in 4.4.2

An example stack trace is:

NoMethodError:
       undefined method `rails5?' for Devise::Test:Module
     # /Users/moncefbelyamani/.gem/ruby/2.3.5/gems/devise-4.4.2/lib/devise/test/controller_helpers.rb:142:in `_process_unauthenticated'
     # /Users/moncefbelyamani/.gem/ruby/2.3.5/gems/devise-4.4.2/lib/devise/test/controller_helpers.rb:118:in `_catch_warden'
     # /Users/moncefbelyamani/.gem/ruby/2.3.5/gems/devise-4.4.2/lib/devise/test/controller_helpers.rb:35:in `process'
     # /Users/moncefbelyamani/.gem/ruby/2.3.5/gems/actionpack-5.1.5/lib/action_controller/test_case.rb:392:in `get'
     # /Users/moncefbelyamani/.gem/ruby/2.3.5/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
     # ./spec/controllers/application_controller_spec.rb:103:in `block (4 levels) in <top (required)>'

Expected behavior

Tests that used to pass with Devise 4.4.1 continue to pass when upgrading Devise to 4.4.2

Bug

Most helpful comment

@rikkipitt I hope to release it today. There's another fix I want to include in this patch, but I think we can finish today.

All 15 comments

This bug was introduced here: https://github.com/plataformatec/devise/commit/3e23371b01443d6b8bdbfcbdcd33d2883847e39d#diff-bafaaa60fc003e648eb4981c9add523e

The same with me + 1

Ouch, the test helpers are using a method from devise's internal test suite, this is definitely wrong.
Sorry about this, we'll look into a fix.

@monfresh can you test if this is fixed by using the branch of #4809?
I wanted to make sure it's working before merging the pull request.

@tegon It works. Thanks!

38 minutes after this was closed, I just had this issue too! When is the next proposed release to include this fix?

Cheers.

@rikkipitt I hope to release it today. There's another fix I want to include in this patch, but I think we can finish today.

@tegon Is release happening today? We are considering pinning to keep our work moving forward, but if it is going to be released any minute... we'll wait.

@tegon, do you anticipate a release that fixes all the deprecation messages that come when using devise with rails 5.1.5?

@elrayle sorry for taking so long to reply. It turns out I couldn't get the other fix ready until today.
But version 4.4.3 is now released.

Thanks everyone for your patience.

@mileslane not yet, but we can look into it. Can you open a different issue for this?

@tegon, surely. Thanks very much.

Thanks so much for cutting a new release! Had similar issues and it was annoying. Great work as always! 馃憤

Not sure if I should open another issue for this, but it appears the gem is cut/released to Rubygems, but when including it in the Gemfile as gem 'devise', '~> 4.4', '>= 4.4.3' and running bundle update devise I get the following error:

Could not find gem 'devise (>= 4.4.3, ~> 4.4)' in any of the gem sources listed in your Gemfile.

Here's the sources in my 5.1.5 Gemfile

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

@nynhex I don't think this is a devise issue, it looks more like a bundler/rubygems issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cheung-chifung picture cheung-chifung  路  4Comments

JanBussieck picture JanBussieck  路  3Comments

mits87 picture mits87  路  3Comments

Gorchel picture Gorchel  路  3Comments

mikeki picture mikeki  路  4Comments