Skip to content

generator system spec: closing 1933 #2075

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

Merged

Conversation

benoittgt
Copy link
Member

This PR is meant to close the #1933

CI will probably fail this is a WIP PR but open for review.

For exemple why do I get:
expected RuntimeError with "System Tests are available for Rails >= 5.1", got #<RuntimeError: System Tests are available for Rails >= 5.1> with backtrace:

@benoittgt benoittgt added the wip label Jan 30, 2019
@benoittgt benoittgt requested a review from JonRowe January 30, 2019 16:10

def generate_system_spec
return unless options[:system_specs]
raise "System Tests are available for Rails >= 5.1" if ::Rails::VERSION::STRING < '5.1'
Copy link
Member Author

Choose a reason for hiding this comment

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

Is it what we want? 🤔

I look at other parts of RSpec code and didn't see that kind of behavior implemented.

Copy link
Member

Choose a reason for hiding this comment

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

The generator shouldn't be available on old rails...

Copy link
Member Author

Choose a reason for hiding this comment

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

So we should have a higher condition if not on > Rails 5.1?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should even define it we can't run it.


describe "system specs" do
subject(:system_spec) { file("spec/system/posts_spec.rb") }
if ::Rails::VERSION::STRING < '5.1'
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want this as a gate or do we want to tag the example to don't be run under Rails 5.1?

@benoittgt benoittgt changed the title Andrzejsliwa/generator system spec generator system spec: closing 1933 Jan 30, 2019
@benoittgt benoittgt force-pushed the andrzejsliwa/generator_system_spec branch from d01c40f to 5a8928d Compare January 31, 2019 17:31
@benoittgt benoittgt force-pushed the andrzejsliwa/generator_system_spec branch from 5a8928d to 79316d2 Compare January 31, 2019 17:31
Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

If this works for you @benoittgt then it looks good to me!

@benoittgt
Copy link
Member Author

Thanks @JonRowe for the review

@benoittgt benoittgt merged commit 82b19bd into rspec:master Feb 1, 2019
@benoittgt benoittgt deleted the andrzejsliwa/generator_system_spec branch February 1, 2019 08:14
benoittgt added a commit that referenced this pull request 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants