Fix Devise 5 compatibility and add GitHub Actions CI#164
Open
tim-gq wants to merge 2 commits into
Open
Conversation
Devise 5 removed the two-argument `sign_in(scope, resource)` form. Use the keyword argument form `sign_in(resource, scope: :scope_name)` which is compatible with both Devise 4 and Devise 5. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add .github/workflows/ci.yml that runs RSpec and Cucumber against both Devise 4 and Devise 5 on Ruby 3.3 and 3.4 - Update Gemfile to respect DEVISE_VERSION env var for pinning the Devise version during CI - Fix spec/dummy/db/schema.rb to use ActiveRecord::Schema[7.2] format required by modern Rails - Fix spec/dummy/config/environments/test.rb: remove whiny_nils (removed in Rails 4) and use show_exceptions = :none (required since Rails 7.1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes test compatibility with Devise 5 and adds a GitHub Actions CI workflow to test against both Devise 4 and Devise 5.
Changes
Fix deprecated
sign_incall in test helper (spec/support/authentication.rb)Devise 5 removed the two-argument
sign_in(scope, resource)form. The keyword argument formsign_in(resource, scope: :scope_name)works with both Devise 4 and Devise 5:Add GitHub Actions CI workflow (
.github/workflows/ci.yml)bundle exec rspecandbundle exec cucumberDEVISE_VERSIONenv var to control Devise version pinningUpdate Gemfile for version matrix support
Added a conditional block that respects the
DEVISE_VERSIONenvironment variable to pindevise ~> 4.9ordevise ~> 5.0. When unset, the gemspec'sdevise >= 4.7.0constraint applies as before.Fix dummy app for modern Rails compatibility
spec/dummy/db/schema.rb: UseActiveRecord::Schema[7.2].define(...)instead of the deprecatedActiveRecord::Schema.define(...)format (required by Rails 7.2+)spec/dummy/config/environments/test.rb: Removeconfig.whiny_nils(removed in Rails 4) and changeshow_exceptions = falsetoshow_exceptions = :none(required since Rails 7.1)