Skip to content

Add request specs for mileage and followup reports controllers#6855

Closed
costajohnt wants to merge 1 commit intorubyforgood:mainfrom
costajohnt:test/improve-controller-test-coverage
Closed

Add request specs for mileage and followup reports controllers#6855
costajohnt wants to merge 1 commit intorubyforgood:mainfrom
costajohnt:test/improve-controller-test-coverage

Conversation

@costajohnt
Copy link
Copy Markdown
Contributor

Summary

  • Replace placeholder controller specs (pending stubs) with proper request specs for MileageReportsController and FollowupReportsController
  • Both controllers serve CSV downloads and authorize via see_reports_page?
  • Follows the same pattern as the existing case_contact_reports_spec.rb

Test plan

  • CI passes all new specs
  • Verify CSV download works for casa_admin and supervisor roles
  • Verify volunteer is redirected (authorization denial)
  • Verify unauthenticated user is redirected to sign in

Addresses #6833

Replace placeholder controller specs with proper request specs for
MileageReportsController and FollowupReportsController. Both controllers
serve CSV downloads and authorize via see_reports_page? which permits
supervisors and admins.

Tests cover:
- Successful CSV download for casa_admin and supervisor
- Authorization denial for volunteer (redirect to root)
- Unauthenticated access (redirect to sign in)
- CSV content verification with actual data

Addresses rubyforgood#6833
@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Apr 14, 2026
@stefannibrasil
Copy link
Copy Markdown
Contributor

Hi @costajohnt sorry for the confusion, but I was already assigned to working on these in #6842 and I am working on them.

I would recommend seeing if there are open issues/PRS already for each file to prevent duplicated work.

@costajohnt costajohnt closed this Apr 15, 2026
@costajohnt costajohnt deleted the test/improve-controller-test-coverage branch April 15, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Pull requests that update Ruby code Tests! 🎉💖👏

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants