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

Lacks a corresponding generator to the Rails 8 authentication system generator #2810

Closed
tnagatomi opened this issue Nov 8, 2024 · 2 comments · Fixed by #2811
Closed

Lacks a corresponding generator to the Rails 8 authentication system generator #2810

tnagatomi opened this issue Nov 8, 2024 · 2 comments · Fixed by #2811

Comments

@tnagatomi
Copy link

What Ruby, Rails and RSpec versions are you using?

Ruby version: 3.3.6
Rails version: 8.0.0
RSpec version: rspec-rails 7.0.1

Observed behaviour

rspec-rails lacks a corresponding generator to the authentication system generator added by Rails 8.0.0 which can be run by bin/rails generate authentication, and produce an error.

Expected behaviour

rspec-rails generates boilerplate specs corresponding to the authentication system generator when you run bin/rails generate authentication.

Can you provide an example reproduction?

  1. Initialize a fresh rails app with rails new --skip-test sample-app
  2. Add rspec-rails to the Gemfile and run bundle install
  3. Run bin/rails generate authentication
  4. Command ends with error rspec [not found] like below:
bin/rails generate authentication
      invoke  erb
      create    app/views/passwords/new.html.erb
      create    app/views/passwords/edit.html.erb
      create    app/views/sessions/new.html.erb
      create  app/models/session.rb
      create  app/models/user.rb
      create  app/models/current.rb
      create  app/controllers/sessions_controller.rb
      create  app/controllers/concerns/authentication.rb
      create  app/controllers/passwords_controller.rb
      create  app/channels/application_cable/connection.rb
      create  app/mailers/passwords_mailer.rb
      create  app/views/passwords_mailer/reset.html.erb
      create  app/views/passwords_mailer/reset.text.erb
      create  test/mailers/previews/passwords_mailer_preview.rb
      insert  app/controllers/application_controller.rb
       route  resources :passwords, param: :token
       route  resource :session
        gsub  Gemfile
      bundle  install --quiet
    generate  migration CreateUsers email_address:string!:uniq password_digest:string! --force
       rails  generate migration CreateUsers email_address:string!:uniq password_digest:string! --force
      invoke  active_record
      create    db/migrate/20241108074415_create_users.rb
    generate  migration CreateSessions user:references ip_address:string user_agent:string --force
       rails  generate migration CreateSessions user:references ip_address:string user_agent:string --force
      invoke  active_record
      create    db/migrate/20241108074416_create_sessions.rb
       error  rspec [not found]
@JonRowe
Copy link
Member

JonRowe commented Nov 8, 2024

PRs welcome 😂

@jeromedalbert
Copy link
Contributor

I took a stab at it in #2811.

@JonRowe JonRowe marked this as a duplicate of #2831 Feb 4, 2025
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 a pull request may close this issue.

3 participants