-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Respect RSpec default_path
for generators
#2508
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
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a02b80d
Respect RSpec `default_path` for generators
vivekmiyani e5847cd
Load RSpec configuration before accessing it
vivekmiyani dda4c6a
Add option to install rspec at custom directory
vivekmiyani c4b3b9e
Add feature to test `default-path` configuration
vivekmiyani 4e694aa
Make generator feature to documentation centered
vivekmiyani 897ec24
Document customize `default-path` configuration
vivekmiyani 8a23888
Add changelog entry
pirj 5fe76cd
Apply suggestions from code review
vivekmiyani 868b66a
Add channel generator feature
vivekmiyani 5f18198
Add controller generator feature
vivekmiyani 7e08864
Add feature generator feature
vivekmiyani 60e200b
Add helper generator feature
vivekmiyani 0670935
Add integration generator feature
vivekmiyani 53ba624
Add job generator feature
vivekmiyani f1d6edf
Add mailbox generator feature
vivekmiyani 3114b8b
Add mailer generator feature
vivekmiyani e4c130a
Add request generator feature
vivekmiyani c935d57
Add system generator feature
vivekmiyani 933bba6
Add view generator feature
vivekmiyani e73d83f
Fix features on Rails 7
pirj 30c7065
Adapt request generator to use custom paths
pirj 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Channel generator spec | ||
|
||
Scenario: Channel generator | ||
When I run `bundle exec rails generate channel group` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
invoke rspec | ||
create spec/channels/group_channel_spec.rb | ||
""" | ||
Then the output should contain: | ||
""" | ||
create app/channels/group_channel.rb | ||
""" | ||
|
||
Scenario: Channel generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate channel group` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
invoke rspec | ||
create behaviour/channels/group_channel_spec.rb | ||
""" | ||
Then the output should contain: | ||
""" | ||
create app/channels/group_channel.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Feature: Controller generator spec | ||
|
||
Scenario: Controller generator | ||
When I run `bundle exec rails generate controller posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/controllers/posts_controller.rb | ||
invoke erb | ||
create app/views/posts | ||
invoke rspec | ||
create spec/requests/posts_spec.rb | ||
invoke helper | ||
create app/helpers/posts_helper.rb | ||
invoke rspec | ||
create spec/helpers/posts_helper_spec.rb | ||
""" | ||
|
||
Scenario: Controller generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate controller posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/controllers/posts_controller.rb | ||
invoke erb | ||
create app/views/posts | ||
invoke rspec | ||
create behaviour/requests/posts_spec.rb | ||
invoke helper | ||
create app/helpers/posts_helper.rb | ||
invoke rspec | ||
create behaviour/helpers/posts_helper_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Feature generator spec | ||
|
||
Scenario: Feature generator | ||
When I run `bundle exec rails generate rspec:feature posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create spec/features/posts_spec.rb | ||
""" | ||
|
||
Scenario: Feature generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate rspec:feature posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create behaviour/features/posts_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Feature: Helper generator spec | ||
|
||
Scenario: Helper generator | ||
When I run `bundle exec rails generate helper posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/helpers/posts_helper.rb | ||
invoke rspec | ||
create spec/helpers/posts_helper_spec.rb | ||
""" | ||
|
||
Scenario: Helper generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate helper posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/helpers/posts_helper.rb | ||
invoke rspec | ||
create behaviour/helpers/posts_helper_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Integration generator spec | ||
|
||
Scenario: Integration generator | ||
When I run `bundle exec rails generate rspec:integration posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create spec/requests/posts_spec.rb | ||
""" | ||
|
||
Scenario: Integration generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate rspec:integration posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create behaviour/requests/posts_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Feature: Job generator spec | ||
|
||
Scenario: Job generator | ||
When I run `bundle exec rails generate job user` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
invoke rspec | ||
create spec/jobs/user_job_spec.rb | ||
create app/jobs/user_job.rb | ||
""" | ||
|
||
Scenario: Job generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate job user` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
invoke rspec | ||
create behaviour/jobs/user_job_spec.rb | ||
create app/jobs/user_job.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Feature: Mailbox generator spec | ||
|
||
Scenario: Mailbox generator | ||
When I run `bundle exec rails generate mailbox forwards` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/mailboxes/forwards_mailbox.rb | ||
invoke rspec | ||
create spec/mailboxes/forwards_mailbox_spec.rb | ||
""" | ||
|
||
Scenario: Mailbox generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate mailbox forwards` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/mailboxes/forwards_mailbox.rb | ||
invoke rspec | ||
create behaviour/mailboxes/forwards_mailbox_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Feature: Mailer generator spec | ||
|
||
Scenario: Mailer generator | ||
When I run `bundle exec rails generate mailer posts index show` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/mailers/posts_mailer.rb | ||
invoke erb | ||
create app/views/posts_mailer | ||
create app/views/posts_mailer/index.text.erb | ||
create app/views/posts_mailer/index.html.erb | ||
create app/views/posts_mailer/show.text.erb | ||
create app/views/posts_mailer/show.html.erb | ||
invoke rspec | ||
create spec/mailers/posts_spec.rb | ||
create spec/fixtures/posts/index | ||
create spec/fixtures/posts/show | ||
create spec/mailers/previews/posts_preview.rb | ||
""" | ||
|
||
Scenario: Mailer generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate mailer posts index show` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create app/mailers/posts_mailer.rb | ||
invoke erb | ||
create app/views/posts_mailer | ||
create app/views/posts_mailer/index.text.erb | ||
create app/views/posts_mailer/index.html.erb | ||
create app/views/posts_mailer/show.text.erb | ||
create app/views/posts_mailer/show.html.erb | ||
invoke rspec | ||
create behaviour/mailers/posts_spec.rb | ||
create behaviour/fixtures/posts/index | ||
create behaviour/fixtures/posts/show | ||
create behaviour/mailers/previews/posts_preview.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Request generator spec | ||
|
||
Scenario: Request generator | ||
When I run `bundle exec rails generate rspec:request posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create spec/requests/posts_spec.rb | ||
""" | ||
|
||
Scenario: Request generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate rspec:request posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create behaviour/requests/posts_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: System generator spec | ||
|
||
Scenario: System generator | ||
When I run `bundle exec rails generate rspec:system posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create spec/system/posts_spec.rb | ||
""" | ||
|
||
Scenario: System generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate rspec:system posts` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create behaviour/system/posts_spec.rb | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Feature: View generator spec | ||
|
||
Scenario: View generator | ||
When I run `bundle exec rails generate rspec:view posts index` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create spec/views/posts | ||
create spec/views/posts/index.html.erb_spec.rb | ||
""" | ||
|
||
Scenario: View generator with customized `default-path` | ||
Given a file named ".rspec" with: | ||
""" | ||
--default-path behaviour | ||
""" | ||
And I run `bundle exec rails generate rspec:view posts index` | ||
Then the features should pass | ||
Then the output should contain: | ||
""" | ||
create behaviour/views/posts | ||
create behaviour/views/posts/index.html.erb_spec.rb | ||
""" |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.