-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Introduce suspenders:testing
generator
#1156
Merged
stevepolitodesign
merged 12 commits into
suspenders-3-0-0
from
suspenders-3-0-0-testing-generator
Mar 8, 2024
Merged
Introduce suspenders:testing
generator
#1156
stevepolitodesign
merged 12 commits into
suspenders-3-0-0
from
suspenders-3-0-0-testing-generator
Mar 8, 2024
Commits on Mar 8, 2024
-
Introduce
suspenders:testing
generatorGenerate `spec/rails_helper.rb` and `spec/spec_helper.rb` via `rails g rspec:intall` in an effort to not drift from what RSpec recommends out of the box. The only thing that differs from the existing `spec/rails_helper.rb` configuration is: ```ruby config.infer_base_class_for_anonymous_controllers = false ``` Note that we still keep `config.fixture_path = "#{::Rails.root}/spec/fixtures"`, in the generated `spec/rails_helper.rb` file even though we favor FactoriesBotRails. This is because we can still use fixtures for things like file uploads. Modify `spec/spec_helper.rb` by including the following: ```ruby config.example_status_persistence_file_path = "tmp/rspec_examples.txt config.order = :random WebMock.disable_net_connect!( allow_localhost: true, allow: "chromedriver.storage.googleapis.com" ) ``` Introduce dependency on [webmock][], and configure RSpec and Minitest to use it. Calling `generate "rspec:install"` seemed to invoked the generator twice (at least in the test), so we rely on `rails_command "generate rspec:install" Additionally, this commit removes the [formulaic][] dependency. A follow-up commit could explore creating a separate one-off generator for this, but for now, we're aiming for the leanest build possible. [webmock]: https://github.com/bblimke/webmock [formulaic]: https://github.com/calebhearth/formulaic
Configuration menu - View commit details
-
Copy full SHA for ed625b7 - Browse repository at this point
Copy the full SHA ed625b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9742372 - Browse repository at this point
Copy the full SHA 9742372View commit details -
For now, drop support for Minitest to maintain existing behavior and continue forward momentum. A follow-up, long-term goal could be to explore how we can improve and extend Minitest and/or the Rails [test cases][] to better match RSpec. [test cases]: https://guides.rubyonrails.org/testing.html#a-brief-note-about-test-cases
Configuration menu - View commit details
-
Copy full SHA for 379c63a - Browse repository at this point
Copy the full SHA 379c63aView commit details -
Deleting a directory feels like an overstep. That should be up to the consumer.
Configuration menu - View commit details
-
Copy full SHA for 0f2505e - Browse repository at this point
Copy the full SHA 0f2505eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cb7765 - Browse repository at this point
Copy the full SHA 9cb7765View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ad8e3e - Browse repository at this point
Copy the full SHA 1ad8e3eView commit details -
I found I needed to add these additional hosts when testing on a fresh Rails app.
Configuration menu - View commit details
-
Copy full SHA for 336eeb9 - Browse repository at this point
Copy the full SHA 336eeb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4c9d36 - Browse repository at this point
Copy the full SHA a4c9d36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 820c87a - Browse repository at this point
Copy the full SHA 820c87aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1675ea1 - Browse repository at this point
Copy the full SHA 1675ea1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b468f32 - Browse repository at this point
Copy the full SHA b468f32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b7c5c7 - Browse repository at this point
Copy the full SHA 2b7c5c7View commit details
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.