Skip to content

Rails 8 issues #2831

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

Closed
brentdodell opened this issue Feb 4, 2025 · 1 comment
Closed

Rails 8 issues #2831

brentdodell opened this issue Feb 4, 2025 · 1 comment

Comments

@brentdodell
Copy link

What Ruby, Rails and RSpec versions are you using?

Ruby version: 3.4.1
Rails version: 8.0.1
RSpec version: 3.13

  • rspec-core 3.13.2
  • rspec-expectations 3.13.3
  • rspec-mocks 3.13.2
  • rspec-rails 7.1.0
  • rspec-support 3.13.2

Observed behaviour

Following the Getting Started With Rails Guide, on Step 11 (Adding Authentication), I get an error when it tries to generate specs.

bin/rails generate authentication
      invoke  tailwindcss
      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/20250204205402_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/20250204205403_create_sessions.rb
       error  rspec [not found]

Expected behaviour

I would expect spec-rails to work with Rails 8, including the generators.

Can you provide an example reproduction?

https://github.com/brentdodell/rspec-test-generation-failure

Run bin/rails generate authentication, notice that rspec step failed with "not found"

@JonRowe
Copy link
Member

JonRowe commented Feb 4, 2025

👋 If you use rspec-rails from Github this has been fixed but is unreleased

@JonRowe JonRowe closed this as completed 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

No branches or pull requests

2 participants