Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rails 8 authentication generator #519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeromedalbert
Copy link

@jeromedalbert jeromedalbert commented Nov 11, 2024

Follow-up to rspec/rspec-rails#2811.

Problem

When running bin/rails generate authentication for a Rails 8 app that has the rspec-rails gem, generation ends with the following error: error factory_bot [not found].

This is because rspec-rails' AuthenticationGenerator contains hook_for :fixture_replacement, which calls factory_bot_rails, but it errors out since factory_bot_rails does not have an authentication generator.

Solution

Add authentication generator that creates a user factory with the email_address and password_digest fields. These fields come from the Rails authentication generator.

@jeromedalbert
Copy link
Author

rspec/rspec-rails#2811 was merged so this PR is ready for review.

@jeromedalbert jeromedalbert changed the title Add Rails 8 authentication generator Support Rails 8 authentication generator Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant