Back to Source Monitor

Mocking Standardization & Test Conventions Guide

.vbw-planning/milestones/07-rails-audit-and-refactoring/06-test-infrastructure/04-SUMMARY.md

0.13.01.2 KB
Original Source

What Was Built

  • TEST_CONVENTIONS.md covering mocking approach (Minitest .stub primary), test naming (imperative mood), job testing patterns, WebMock stub conventions, time travel, test isolation, and factory helpers
  • Advisory lock test refactored with convention-compliant comments explaining why Class.new is used over .stub
  • FeedFetcherTestHelper expanded with four reusable WebMock stub helpers: stub_feed_request, stub_feed_timeout, stub_feed_not_found, stub_feed_connection_failed

Commits

  • eea34ac docs(06-04): create TEST_CONVENTIONS.md
  • 29e817f refactor(06-04): add mocking convention comments to advisory_lock_test
  • 5edfb8f feat(06-04): add reusable WebMock stub helpers to FeedFetcherTestHelper

Tasks Completed

  • Create TEST_CONVENTIONS.md (175 lines, under 200 limit)
  • Refactor advisory_lock_test mocking (Class.new retained with justification comment)
  • Consolidate feed_fetcher_test_helper stubs (4 new helpers added)

Files Modified

  • test/TEST_CONVENTIONS.md (created)
  • test/lib/source_monitor/fetching/advisory_lock_test.rb (modified)
  • test/lib/source_monitor/fetching/feed_fetcher_test_helper.rb (modified)

Deviations

None.