Running rails g rspec:request Dummy does not create a request spec

23 views
Skip to first unread message

belgoros

unread,
Mar 25, 2019, 10:03:00 AM3/25/19
to rspec
I'm migrating a Rails 4 app using rspec-rails 3.2 to Rails 5.2 and RSpec 3.8.2 and getting a weird issue when no request spec is generated when running the corresponding generator command:

rails g rspec:request Dummy

I've already re-generated the app binstubs with

rails app:update:bin


but still without success.

When I display the available tasks, the RSpec's ones are listed correctly:

rails generate --help

Usage: rails generate GENERATOR [args] [options]


General options:

  -h, [--help]     # Print generator's options and usage

  -p, [--pretend]  # Run but do not make any changes

  -f, [--force]    # Overwrite files that already exist

  -s, [--skip]     # Skip files that already exist

  -q, [--quiet]    # Suppress status output


Please choose a generator below.


Rails:

  application_record

  assets

  channel

  controller

  generator

  helper

  integration_test

  job

  mailer

  migration

  model

  resource

  scaffold

  scaffold_controller

  system_test

  task


ActiveRecord:

  active_record:application_record

  active_record:migration

  active_record:model


Coffee:

  coffee:assets


FactoryGirl:

  factory_girl:model


Js:

  js:assets


Rspec:

  rspec:controller

  rspec:feature

  rspec:helper

  rspec:install

  rspec:integration

  rspec:job

  rspec:mailer

  rspec:model

  rspec:observer

  rspec:request

  rspec:scaffold

  rspec:view


What am I missing ?
Thank you.

belgoros

unread,
Mar 25, 2019, 10:15:19 AM3/25/19
to rspec
How ever, it works for a model:

rails generate rspec:model Dummy


create  spec/models/dummy_spec.rb

      invoke  factory_girl

      create    spec/factories/dummies.rb

belgoros

unread,
Mar 25, 2019, 10:17:25 AM3/25/19
to rspec
And here is what I get when checking the available RSpec generators:

rails generate --help | grep rspec


rspec
:controller
  rspec
:feature
  rspec
:helper
  rspec
:install
  rspec
:integration
  rspec
:job
  rspec
:mailer
  rspec
:model
  rspec
:observer
  rspec
:request
  rspec
:scaffold
  rspec
:view



On Monday, 25 March 2019 15:03:00 UTC+1, belgoros wrote:

Jon Rowe

unread,
Mar 27, 2019, 5:51:37 AM3/27/19
to rs...@googlegroups.com
Hi

The commands you are using should work, but the generators can be configured to be off, would you mind creating a new repo + app with your versions of Rails and RSpec and try there? If it doesn’t work if you could open source that new repo and then open an issue on Github that’d be great.

Cheers
Jon Rowe
---------------------------

Serguei Cambour

unread,
Mar 27, 2019, 8:05:53 AM3/27/19
to rs...@googlegroups.com
The app is available here: https://github.com/belgoros/jlc-invest/tree/ruby_2_6

Thank you

--
You received this message because you are subscribed to a topic in the Google Groups "rspec" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rspec/Uqmz7M5-BD4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-ed4c30a2-1014-4097-89db-6b6c3e4f31f2%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Jon Rowe

unread,
Mar 27, 2019, 6:13:36 PM3/27/19
to rs...@googlegroups.com
Hi sorry,

I meant to try it with an empty application using the same versions, as a reproduction of the bug, and if so open a GitHub issue with it.

Sorry I don’t have the time to investigate the issue within your full application. Sorry!

Jon Rowe
---------------------------
Reply all
Reply to author
Forward
0 new messages