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
I want to generate system spec from rails generator command when running
$> rails g rspec:system products/create
Rails will create spec/system/product/create_spec.rb
file and system spec template inside file.
Error (Generator command still not available):
Could not find generator 'rspec:system'. Maybe you meant 'rspec:helper', 'rspec:install' or 'rspec:mailer'
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
Hello,
I can get started on this if its still up for grabs!
Go for it
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?
Ah my mistake, thanks for checking, #2084 is very similar if you'd like to tackle that instead?