Fix bare HTTP status check warnings in specs
Description
Recent Comments
## Code Review ### Spec Pattern Search - Searched for existing spec patterns: `find spec -name "*spec.rb" | sort` - Found 45 spec files in the codebase including patterns for controller specs, request specs, feature specs, model specs, etc. ### Test Results - Test suite run: `bundle exec rspec` on PR branch - Results: **700 examples, 2 failures, 7 pending** ### Analysis of Test Failures The 2 failures in `spec/features/dashboard_spec.rb` are **pre-existing issues on main branch** - they also fail on main. These are unrelated Capybara UI issues: - `dashboard_spec.rb:4` - "Dashboard" text not visible - `dashboard_spec.rb:17` - "Kanban" link not visible These failures exist on both main and PR branch. The PR did not introduce them. ### Bare HTTP Status Check Warnings - **Main branch**: Multiple bare HTTP status check warnings displayed during test run - **PR branch**: **No warnings displayed** - all successfully fixed ### Changes Verified The PR correctly replaced bare `have_http_status` checks with appropriate matchers: - API success (200 JSON): `expect_api_success` / `have_api_success` ✅ - API errors (401, 403, 404, 422): `expect_api_error` / `have_api_error` ✅ - Non-API responses (201, 204): `have_error_response` ✅ ### Files Modified (13 spec files) - spec/controllers/api/v1/*_spec.rb (5 files) - spec/requests/api/v1/*_spec.rb (3 files) - spec/requests/*_spec.rb (4 files) - spec/support/shared_examples.rb ### Decision **PASS** The PR successfully accomplished all acceptance criteria: 1. ✅ Identified all bare HTTP status check warnings 2. ✅ Replaced each with appropriate matcher that validates response body 3. ✅ No warnings displayed when running specs The 2 dashboard test failures are pre-existing UI issues unrelated to this PR.
Ticket Stats
Comments
1 commentsAdd a Comment
No Subtasks Yet
Break down this ticket into smaller, manageable subtasks