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

System spec generator still not supported #2082

Closed
philiplambok opened this issue Feb 24, 2019 · 5 comments
Closed

System spec generator still not supported #2082

philiplambok opened this issue Feb 24, 2019 · 5 comments

Comments

@philiplambok
Copy link

philiplambok commented Feb 24, 2019

What Ruby, Rails and RSpec versions are you using?

Ruby version: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
Rails version: Rails 5.2.2
Rspec version: RSpec 3.8

Observed behavior

I want to generate system spec from rails generator command when running

$> rails g rspec:system products/create

Expected behaviour

Rails will create spec/system/product/create_spec.rb file and system spec template inside file.

Actual behaviour

Error (Generator command still not available):

Could not find generator 'rspec:system'. Maybe you meant 'rspec:helper', 'rspec:install' or 'rspec:mailer'
@JonRowe
Copy link
Member

JonRowe commented Feb 24, 2019

This would be a great small PR for someone, our other generators should serve as an example to follow, and tweaked to generate the relevant template for a system spec

@ConSou
Copy link
Contributor

ConSou commented Feb 26, 2019

Hello,
I can get started on this if its still up for grabs!

@JonRowe
Copy link
Member

JonRowe commented Feb 26, 2019

Go for it

@ConSou
Copy link
Contributor

ConSou commented Feb 26, 2019

Hey, I believe this issue may have already been resolved after taking a deeper look at the project. Upon forking and cloning the master branch I was looking in the lib/generators/rspec directory and found a system directory containing system_generator.rb and templates. In addition I found a system generator spec that seemed to verify the generator for system. I then verified the issue with a recent project I was using RSpec 3.8 and found running rails g rspec:system products/create did produce the error Could not find generator 'rspec:system'. Maybe you meant 'rspec:helper', 'rspec:install' or 'rspec:mailer’. From here I created a new test project and added the rspec-rails gem, setting the path to be the local clone of the project. From here I was able to run rails g rspec:system products/create successfully and verified that a spec/system/products directory was created and products_create_spec.rb was also created from the system spec template. Maybe I am missing something but it appears that this issue may have already been resolved/fixed?

@JonRowe
Copy link
Member

JonRowe commented Feb 26, 2019

Ah my mistake, thanks for checking, #2084 is very similar if you'd like to tackle that instead?

@JonRowe JonRowe closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants