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

Introduce suspenders:factories generator #1136

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

stevepolitodesign
Copy link
Contributor

@stevepolitodesign stevepolitodesign commented Oct 27, 2023

Maintains functionally with the existing generator while adding
support for the default Rails test suite. With this change, the
generator can be invoked on a Rails application that use RSpec and the
default Rails test suite.

Adds generator which adds a test to lint all Factories in an effort to
improve developer experience.

Additionally, we remove the generation of the dev:prime task as we
felt that should be the responsibly of another generator.

How to review this pull request

Review is easier when compared with the existing generator.

Additionally, if you want to manually test these changes, spin up a new rails app and add the following:

group :development, :test do
  gem "suspenders", git: "https://github.com/thoughtbot/suspenders", branch: "factory-bot-generator"
end

Comment on lines 10 to 12
destination Rails.root
setup :prepare_destination
teardown :restore_destination
Copy link
Contributor Author

Choose a reason for hiding this comment

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

destination is set to test/dummy, which is a blank Rails app.
setup and teardown handle adding or removing files needed for this specific test to run. For example, adding the Gemfile.

@mike-burns

This comment was marked as resolved.

@stevepolitodesign
Copy link
Contributor Author

Why is this a new generator instead of a modification/replacement for suspenders:factories?

@mike-burns that was an oversite on my part. Fixed here: 1455dc1

@stevepolitodesign stevepolitodesign changed the title Introduce suspenders:factory_bot generator Introduce suspenders:factories generator Nov 8, 2023
@stevepolitodesign stevepolitodesign force-pushed the factory-bot-generator branch 2 times, most recently from 50f1603 to d2e4b85 Compare November 8, 2023 21:25
@stevepolitodesign stevepolitodesign mentioned this pull request Nov 9, 2023
17 tasks
NEWS.md Outdated Show resolved Hide resolved
Maintains functionally with the [existing generator][] while adding
support for the [default Rails test suite]. With this change, the
generator can be invoked on a Rails application that uses RSpec and the
default Rails test suite.

Adds generator which adds a test to lint all Factories in an effort to
improve developer experience.

Additionally, we remove the generation of the `dev:prime` task as we
felt that should be the responsibly of another generator.

[existing generator]: https://github.com/thoughtbot/suspenders/blob/main/lib/suspenders/generators/factories_generator.rb
[default Rails test suite]: https://guides.rubyonrails.org/testing.html
@stevepolitodesign stevepolitodesign merged commit 4f20aa8 into suspenders-3-0-0 Nov 17, 2023
2 checks passed
@stevepolitodesign stevepolitodesign deleted the factory-bot-generator branch November 17, 2023 15:17
stevepolitodesign added a commit that referenced this pull request May 10, 2024
Maintains functionally with the [existing generator][] while adding
support for the [default Rails test suite]. With this change, the
generator can be invoked on a Rails application that uses RSpec or the
[default Rails test suite][].

Adds generator which adds a test to lint all Factories in an effort to
improve developer experience.

Additionally, we remove the generation of the `dev:prime` task as we
felt that should be the responsibly of another generator.

[existing generator]: https://github.com/thoughtbot/suspenders/blob/main/lib/suspenders/generators/factories_generator.rb
[default Rails test suite]: https://guides.rubyonrails.org/testing.html
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.

3 participants