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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove item generation #4206

Merged
merged 8 commits into from
May 17, 2024
Merged

Conversation

elasticspoon
Copy link
Collaborator

@elasticspoon elasticspoon commented Mar 20, 2024

spec/rails_helper.rb Outdated Show resolved Hide resolved
@elasticspoon elasticspoon force-pushed the remove-test-item-creation branch 3 times, most recently from 6159db3 to 6b6e90c Compare March 21, 2024 05:48
@dorner
Copy link
Collaborator

dorner commented Mar 22, 2024

Yes, this looks great! I'd try to limit the unrelated changes because this is already a really beefy PR.

@elasticspoon
Copy link
Collaborator Author

This is just a really early draft. But what do you think is the best way to break it up?

I was thinking:

  • PR with setup -> stuff to enable the flags + modifications to factories if needed
  • 1 PR per X amount of spec files (I was thinking maybe 5-8?)

I was also replacing some some validations and adding association tests with shoulda matchers, which is what I assume you mean by unrelated changes. It made sense to me to "spruce" up the specs and I would open a seperate PR for those changes.

That said. How do you feel about replacing some of those validations with shoulda matchers? I know a lot of people are kind of against them.

@dorner
Copy link
Collaborator

dorner commented Mar 22, 2024

I was more referring to things like https://github.com/rubyforgood/human-essentials/pull/4206/files#diff-f20ad13724257719bda72f3a7df9e41664e7c5dd4c8ac8f20a08016c72a7ebb4L29 and https://github.com/rubyforgood/human-essentials/pull/4206/files#diff-9f295d05ef1f1d3fa56e894bd8858741bccb3bae309333f4ee47bd2de3aba8c2R120 .

Honestly, I don't find a lot of value at all in the specs that just restate what the model has on it (things like belongs_to or validates_presence_of). Unless it's doing something unusual, like a regex or conditional validation, I don't think we need tests for them at all - that behavior should definitely be tested through one of the higher-level model, request or system tests.

@dorner
Copy link
Collaborator

dorner commented Mar 22, 2024

I think the way you want to break it makes a lot of sense - let's make it 10 specs as a nice round number and so we don't have dozens of PRs 馃槃

@elasticspoon elasticspoon force-pushed the remove-test-item-creation branch 3 times, most recently from 651f6bf to 5baf08a Compare March 25, 2024 00:34
@elasticspoon elasticspoon force-pushed the remove-test-item-creation branch 2 times, most recently from 411c77a to e60536d Compare May 12, 2024 15:41
@elasticspoon elasticspoon force-pushed the remove-test-item-creation branch 3 times, most recently from 7dcf7fa to 1088d90 Compare May 15, 2024 17:10
@elasticspoon elasticspoon marked this pull request as ready for review May 15, 2024 17:17
@elasticspoon elasticspoon requested a review from dorner May 15, 2024 17:17
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

I think a file was checked in by accident?

replace.sh Outdated Show resolved Hide resolved
@elasticspoon elasticspoon requested a review from dorner May 16, 2024 00:49
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

One last merge mixup I think! Btw can you please ensure you are not force pushing the branch? I.e. when you merge master please ensure you are using merge and not rebase.

spec/requests/distributions_by_county_spec.rb Outdated Show resolved Hide resolved
@elasticspoon elasticspoon requested a review from dorner May 17, 2024 20:00
@dorner dorner merged commit 3d4b658 into rubyforgood:main May 17, 2024
19 checks passed
@dorner
Copy link
Collaborator

dorner commented May 17, 2024

Finally done! Kudos on a very long and tedious project - I am super happy with the changes! 馃帀

@elasticspoon elasticspoon deleted the remove-test-item-creation branch May 17, 2024 20:16
Copy link
Contributor

@elasticspoon: Your PR remove item generation is part of today's Human Essentials production release: 2024.05.26.
Thank you very much for your contribution!

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.

Revamp specs to stop relying on seeded data
2 participants