5
11
Fork
You've already forked tomato
1

Convert user factories to traits #136

Merged
edwardloveall merged 1 commit from el-user-factory-traits into main 2026年04月13日 15:35:53 +02:00

This accomplishes two things: making the object creation more explicit (this is
a user object) and also not creating a hidden organization in the background. In
tests, the organization a volunteer belongs to is used in other parts of the
test, so implicitly creating it is most likely just going to create an unused
record. It's better in my opinion to explicitly create the record.

This accomplishes two things: making the object creation more explicit (this is a user object) and also not creating a hidden organization in the background. In tests, the organization a volunteer belongs to is used in other parts of the test, so implicitly creating it is most likely just going to create an unused record. It's better in my opinion to explicitly create the record.
jsilasbailey left a comment
Copy link

Love the inline org creation!

Love the inline org creation!
@ -23,3 +19,3 @@
it "redirects to the org list page when user is an org admin with multiple orgs" do
sign_in @multiple_orgs_admin
org1 = create(:organization)
First-time contributor
Copy link

(can't endorse this enough, let's just say... from experience)

➕ (can't endorse this enough, let's just say... from experience)
@ -8,3 +8,3 @@
describe "validate_email" do
it "returns true for valid email address" do
user = create(:volunteer, email: "foo@bar.com")
user = create(:user, :volunteer, email: "foo@bar.com")
First-time contributor
Copy link

Just curious about your workflow for these find/replace tasks, are you still using something "grep/sed"-like? Have you seen ast-grep before? I've found it incredibly helpful, esp. for api change upgrades!

Just curious about your workflow for these find/replace tasks, are you still using something "grep/sed"-like? Have you seen [ast-grep](https://ast-grep.github.io/) before? I've found it incredibly helpful, esp. for api change upgrades!
Author
Owner
Copy link

I've tried to wrap my head around ast-grep several times but I can't seem to grok it's syntax. It seems like such a good idea but a terrible (for me) api. If you have good resources outside their official docs, please share them.

I used okapi which is just a find and replace interface, but it worked well for finding these.

I've tried to wrap my head around ast-grep several times but I can't seem to grok it's syntax. It seems like such a good idea but a terrible (for me) api. If you have good resources outside their official docs, please share them. I used [okapi](https://github.com/nk9/okapi) which is just a find and replace interface, but it worked well for finding these.
edwardloveall force-pushed el-user-factory-traits from e5573b603c
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
to a8a0af6ffd
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
2026年04月13日 15:28:10 +02:00
Compare
edwardloveall changed target branch from el-dialog-turbo-fix to main 2026年04月13日 15:28:22 +02:00
Author
Owner
Copy link

The test flake there is a weird one, but not uncommon. I haven't been able to track it down.

The test flake there is a weird one, but not uncommon. I haven't been able to track it down.
edwardloveall deleted branch el-user-factory-traits 2026年04月13日 15:35:54 +02:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!136
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-user-factory-traits"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?