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

generator for system spec #1933

Closed
wants to merge 3 commits into from
Closed

Conversation

andrzejsliwa
Copy link

Rspec since 3.7 is supporting the system specs, so would be great to add generator for it.

@JonRowe
Copy link
Member

JonRowe commented Jan 5, 2018

I think you need to make sure these specs only run on rails versions that support system specs.

@joshRpowell
Copy link

@andrzejsliwa #2071 looks like a good candidate for including this PR

@JonRowe
Copy link
Member

JonRowe commented Jan 28, 2019

No this can be independant, it just needs to be gated on Rails version

class SystemGenerator < Base
class_option :system_specs, :type => :boolean, :default => true, :desc => "Generate system specs"

def generate_feature_spec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be generate_system_spec?

class_option :system_specs, :type => :boolean, :default => true, :desc => "Generate system specs"

def generate_feature_spec
return unless options[:system_specs]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrzejsliwa perhaps you'll have something more elegant in mind, but inserting something like this is a start:

begin
  raise ArgumentError.new('System Tests are available for Rails >= 5.1') if Rails::VERSION::STRING < '5.1'
rescue ArgumentError => e
  puts e.message
end

@joshRpowell
Copy link

No this can be independant, it just needs to be gated on Rails version

Thanks @JonRowe. Dropped a something to jumpstart the conversation again.

benoittgt added a commit that referenced this pull request Feb 1, 2019
@benoittgt
Copy link
Member

Closed via: #2075 thanks @andrzejsliwa and @joshRpowell 🎉

@benoittgt benoittgt closed this Feb 1, 2019
benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request Feb 22, 2019
benoittgt added a commit that referenced this pull request Feb 22, 2019
benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request May 1, 2019
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 this pull request may close these issues.

None yet

4 participants