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

Consistent request spec naming #2378

Merged
merged 3 commits into from Aug 26, 2020
Merged

Consistent request spec naming #2378

merged 3 commits into from Aug 26, 2020

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Aug 26, 2020

Bare minimum changes required to get consistent spec naming, replaces #2376

eloyesp and others added 3 commits August 26, 2020 06:22
Controller generators are using a different naming scheme for requests
specs that are now generated by default. Use always
`spec/requests/posts_spec.rb` by default.

This
@JonRowe JonRowe merged commit 5d76f46 into main Aug 26, 2020
@JonRowe JonRowe deleted the consistent-request-spec-naming branch August 26, 2020 06:11
@JonRowe
Copy link
Member Author

JonRowe commented Aug 26, 2020

Thanks for getting this over the line @klyonrad

Copy link
Contributor

@klyonrad klyonrad left a comment

Choose a reason for hiding this comment

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

Also thanks for finishing this up. Got one question though

generate('rspec:request wombats')

# request specs are now the default
generate('rspec:controller wombats --no-request-specs --controller-specs --no-view-specs')
Copy link
Contributor

Choose a reason for hiding this comment

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

Funny, I didn't know that about this generator. But to be honest I don't understand the purpose of this line 🤔

One more testing of controller specs? I thought the whole issue was about request specs

Copy link
Member Author

Choose a reason for hiding this comment

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

The rspec: bit means just the rspec generator, not the rails generator, so its the same as invoking controller wombats ... only it does't produce a controller.

One more testing of controller specs? I thought the whole issue was about request specs

This is fixing an issue the rename raised, this lines original purpose was to complete the coverage of the generators.

At the time the lines above generated controller specs for wombats, so we added a request spec to complete the mix. When the default became request specs this should have changed to a controller spec to restore the coverage.

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 the rename showed a duplicate spec being generated, which resolving the original coverage issue solves.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, now I see what you were reading into those lines... I was interpreting them in a very different way.

I thought that

generate('rspec:request wombats')
generate('integration_test widgets')

were just for testing the RequestSpecGenerator or to have test coverage of request specs in general.


The rspec: bit means just the rspec generator, not the rails generator, so its the same as invoking controller wombats ... only it does't produce a controller.

But couldn't this be also achieved (and be more explicit) by changing line 87 to generate('controller wombats index --controller-specs')?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yep I guess that'd also work

pirj pushed a commit that referenced this pull request Sep 2, 2020
This was referenced Mar 15, 2021
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

3 participants