Skip to content

chore: use the API timestamp format in spec fixtures - #215

Merged
felipefreitag merged 1 commit into
mainfrom
fix/timestamp-format-fixtures
Aug 6, 2026
Merged

chore: use the API timestamp format in spec fixtures#215
felipefreitag merged 1 commit into
mainfrom
fix/timestamp-format-fixtures

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

The API returns timestamps in Postgres text format: YYYY-MM-DD HH:MM:SS[.ffffff]+00 (for example 2023-10-06 23:47:56.678+00). Spec fixtures and their assertions showed ISO 8601 for response fields. This PR makes them match the real API output.

  • Convert 120 response-fixture timestamps and paired assertions in 24 spec files.
  • spec/emails/receiving_spec.rb:113 already used the correct format; the rest of the repo now matches it.

What stays ISO 8601 on purpose

  • scheduled_at as a request param (spec/emails_spec.rb, examples/schedule_email.rb). The API accepts ISO there.
  • The webhook event payload strings in the signature verification specs. Webhooks emit ISO, and these strings feed the HMAC computation.
  • revoked_at in the revoke OAuth grant response. That endpoint returns ISO.

Why

The SDK never parses these values, so there are no runtime changes. But wrong fixtures propagate: new endpoints copy the pattern, and users who read the specs get the wrong contract.

Verification

  • bundle exec rake spec: 336 examples, 0 failures.
  • bundle exec rubocop: no offenses.

Summary by cubic

Updated spec fixtures and assertions to use the API’s Postgres timestamp format so tests match real responses. No runtime changes.

  • Refactors
    • Converted 120 timestamps across 24 spec files from ISO 8601 to Postgres text format (YYYY-MM-DD HH:MM:SS[.ffffff]+00).
    • Kept ISO 8601 where the API uses it: scheduled_at request param, webhook event payload strings in signature specs, and revoked_at in the revoke OAuth grant response.

Written for commit 037b2c4. Summary will update on new commits.

Review in cubic

The API returns timestamps in Postgres text format
(2023-10-06 23:47:56.678+00), not ISO 8601. Spec fixtures and
their assertions showed ISO 8601 for response fields.

Convert response fixtures and assertions to the real format.

Keep ISO 8601 where the API uses it: the scheduled_at request
param, webhook event payloads used in signature tests, and
revoked_at in the revoke response.

No runtime changes.
@felipefreitag
felipefreitag requested a review from drish August 6, 2026 14:31

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 24 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: All changes are in spec fixtures, converting 120 timestamps from ISO 8601 to the API's Postgres text format. No runtime logic, schema, or public contract changes. The diff confirms a focused test alignment with no meaningful tradeoffs for human review.

Re-trigger cubic

@felipefreitag
felipefreitag merged commit 72be6bd into main Aug 6, 2026
10 checks passed
@felipefreitag
felipefreitag deleted the fix/timestamp-format-fixtures branch August 6, 2026 15:01
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