5
11
Fork
You've already forked tomato
1

Fix absence email spec #4

Merged
edwardloveall merged 2 commits from el-fix-absence-email-spec into main 2025年08月05日 22:13:37 +02:00

Faker's randomness was causing certain tests to fail randomly. Names would sometimes contain apostrophes (or potentially other symbols) which get encoded as HTML entities that don't match.

Instead of using random Faker names, this uses predictable sequences like "Organization 1", "Organization 2", etc.

I confirmed that emails still encode HTML entities correctly:

  • Create an org that has a Rootable Alerts Contact Email
  • Create a recurring shift that has a name with an apostrophe
  • As a volunteer, pick up the recurring shift
  • As that volunteer, schedule an absence that overlaps with one of the
    shift occurrences
  • See the encoded entity in the rails logs (or mailcatcher)

I also configured faker to use the same seed as rspec so we can reproduce faker failures easily.

Faker's randomness was causing certain tests to fail randomly. Names would sometimes contain apostrophes (or potentially other symbols) which get encoded as HTML entities that don't match. Instead of using random Faker names, this uses predictable sequences like "Organization 1", "Organization 2", etc. I confirmed that emails still encode HTML entities correctly: * Create an org that has a Rootable Alerts Contact Email * Create a recurring shift that has a name with an apostrophe * As a volunteer, pick up the recurring shift * As that volunteer, schedule an absence that overlaps with one of the shift occurrences * See the encoded entity in the rails logs (or [mailcatcher](https://mailcatcher.me/)) I also configured faker to use the same seed as rspec so we can reproduce faker failures easily.
If a test fails because faker generated some bad data, it's useful to
recreate the scenario using the rspec seed.
https://github.com/faker-ruby/faker/issues/2281 
Predictably name shifts, events, and orgs
All checks were successful
Setup Successful
Jest Successful
RSpec Successful
Static Analysis Successful
35c88242a2
Faker's randomness was causing certain tests to fail randomly. Names
would sometimes contain apostrophes (or potentially other symbols)
which get encoded as HTML entities that don't match.
Instead of using random Faker names, this uses predictable sequences
like "Organization 1", "Organization 2", etc.
I confirmed that emails still encode HTML entities correctly:
* Create an org that has a Rootable Alerts Contact Email
* Create a recurring shift that has a name with an apostrophe
* As a volunteer, pick up the recurring shift
* As that volunteer, schedule an absence that overlaps with one of the
shift occurrences
* See the encoded entity in the rails logs (or mailcatcher)
edwardloveall deleted branch el-fix-absence-email-spec 2025年08月05日 22:13:38 +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!4
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-fix-absence-email-spec"

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?