-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Consistent request spec file naming #2376
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed again in #2375
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wouldn't have to do the above if you stick to wombats and widgets? Are these changes even necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you seen the test output for the commit before that 9f0bc1f?
The IntegrationSpecGenerator / RequestSpecGenerator generate a file with an index_path helper that does not exist when we have not generated the corresponding route yet, causing a failure of the smoke tests. So there was a hidden dependency between generating the controllers and testing the generated request specs. That I think you understood, right?
This was a very surprising dependency by the way. Dependencies in this
generates_stuff
file are quite the pain generally. And I assume that these test failures were what motived @eloyesp to change the behaviour in the previous PR.When we stick to wombats and widgets, then we would try to overwrite the already generated request spec files from the earlier lines.
generate('controller wombats index')
generatesspec/requests/wombats_spec.rb
. Thengenerate('rspec:request wombats')
was also trying to generatespec/requests/wombats_spec.rb
, so a conflict. We could try using the--force
option to just ignore that file conflict but I thought that then it would be pointless to even use the request spec generator here.The usage of
--no-request_specs
is necessary so that generating the controller does not change the conflicting file name. The usage--no-view_specs --no-helper_specs
options I just added to avoid unnecessary increase in testing time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are controllers generated above, if they are missing a route then ok add some more, but don't remove the old ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean.
Could you please checkout the commit locally, run
rake smoke:app
, see the failures and tell more detailed how you would solve them?I did not remove anything. I changed the names for using the request spec generation and the integration_test generation.
generate('rspec:request wombats')
fails becausegenerate('controller wombats index')
already has generated the request spec file. This was not an issue before becausegenerate('rspec:request wombats')
generatedspec/requests/wombats_request_spec
file. And this file worked only becausegenerate('controller wombats index')
created the correct route.generate('integration_test widgets')
would work, but the filespec/requests/widgets_spec
will later on be overwritten bygenerate('scaffold widget name:string category:string instock:boolean foo_id:integer bar_id:integer --force')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I pulled down your branch and ran it and the main issue is that the generator now overwrites itself due to the change in defaults, fixed in #2378