Skip to content

test: close coverage gaps — 51% → 97%#7

Merged
eclectic-coding merged 7 commits into
mainfrom
chore/close-coverage-gaps
May 25, 2026
Merged

test: close coverage gaps — 51% → 97%#7
eclectic-coding merged 7 commits into
mainfrom
chore/close-coverage-gaps

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds request specs for all previously uncovered controllers: FailedJobsController, QueuesController, ProcessesController, CacheController, CableController
  • Adds jobs#destroy specs (HTML redirect, filter param preservation, Turbo Stream row removal, empty-state replacement, 422 guard)
  • Adds authentication specs covering the truthy and falsy auth block paths
  • Adds SolidStackWeb.configure unit spec
  • Coverage: 51.98% → 97.37%

Bugs fixed while writing specs

  • FailedJobsController#destroy used a local execution variable — the Turbo Stream view had no @execution to reference, so inline row removal silently did nothing
  • failed_jobs/index.html.erb called .lines on a Hash — SolidQueue v1.3+ serializes error as JSON; replaced with execution.exception_class
  • Missing failed_jobs/destroy.turbo_stream.erb — added to support inline row removal (mirrors jobs destroy behaviour)
  • Replaced deprecated Rack status :unprocessable_entity with :unprocessable_content

Test plan

  • bundle exec rspec — 66 examples, 0 failures, 97.37% coverage

🤖 Generated with Claude Code

eclectic-coding and others added 7 commits May 25, 2026 15:37
… processes

Adds request specs for all previously uncovered controllers:
- FailedJobsController: index, destroy (HTML + Turbo Stream), retry
- QueuesController: index, pause, resume
- ProcessesController: index
- Cache/Cable: pending stubs (controllers not yet fully built out)

Also fixes two production bugs found during spec authoring:
- FailedJobsController#destroy used local `execution` instead of @execution,
  preventing the Turbo Stream view from referencing the discarded record
- failed_jobs index view called `.lines` on a Hash — SolidQueue serializes
  `error` as JSON; replaced with `execution.exception_class` accessor
- Adds destroy.turbo_stream.erb for failed_jobs to support inline row removal

Coverage: 51.98% → 79.11%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers HTML redirect, filter param preservation, turbo_stream row
removal, empty-state replacement, and the 422 guard for non-discardable
statuses (claimed jobs).

Coverage: 90.13% → 94.74%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tent

Rack deprecated :unprocessable_entity in favour of :unprocessable_content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onfigure

- jobs#show: adds a spec for malformed arguments that exercises the
  rescue JSON::ParserError branch, ensuring a 200 is still returned
- SolidStackWeb.configure: new unit spec verifies the yield-self block
  pattern used in host-app initializers

Coverage: 94.74% → 96.05%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a dedicated authentication request spec exercising:
- auth block returns truthy → request passes through (200)
- auth block returns falsy → falls back to HTTP Basic (401)

Also adds SolidStackWeb.configure unit spec (yield-self block).

Coverage: 94.74% → 97.37%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit 82b1c49 into main May 25, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the chore/close-coverage-gaps branch May 25, 2026 19:50
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.

1 participant