Skip to content

Assert logged events using have_logged_event (part 2)#11010

Merged
aduth merged 2 commits intomainfrom
aduth-track-event-have-logged-event-2
Jul 31, 2024
Merged

Assert logged events using have_logged_event (part 2)#11010
aduth merged 2 commits intomainfrom
aduth-track-event-have-logged-event-2

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jul 31, 2024

🛠 Summary of changes

Updates specs to replace expect(@analytics).to receive(:track_event).with with equivalent expect(@analytics).to have_logged_event.

This follows #11001, and includes updating some of the more involved analytics stubbing.

Why?

  • Because have_logged_event includes a number of additional helpers implemented through the FakeAnalytics class:
    • Accidental PII leak detection
    • Undocumented analytics method arguments checking
  • Facilitate work in Analytics: Compact event properties #10987

📜 Testing Plan

Verify build passes.

Verify that there are no lingering references to stubbed :track_event for Analytics class in the spec/ directory.

changelog: Internal, Automated Testing, Assert logged events using have_logged_event
@aduth aduth merged commit 2c1d38c into main Jul 31, 2024
@aduth aduth deleted the aduth-track-event-have-logged-event-2 branch July 31, 2024 14:47
mitchellhenke pushed a commit that referenced this pull request Jul 31, 2024
* Assert logged events using have_logged_event (part 2)

changelog: Internal, Automated Testing, Assert logged events using have_logged_event

* Remove unnecessary allowed_extra_analytics
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.

2 participants