---
id: task-40
title: 'Write spec for Tasks::Fa::EnqueueDueUserPageScansTask'
status: To Do
assignee: []
created_date: '2025-07-08'
labels: []
dependencies: []
---

## Description

Create comprehensive test coverage for the FA user page scan task enqueuing logic to ensure proper job scheduling, duplicate handling, and queue management.

## Acceptance Criteria

- [ ] Spec file exists at spec/lib/tasks/fa/enqueue_due_user_page_scans_task_spec.rb
- [ ] Tests verify start_enqueuing method enqueues correct jobs
- [ ] Tests verify queue_size method returns accurate count
- [ ] Tests verify progress_key returns correct key
- [ ] Tests verify enqueuing stops when users are recently scanned
- [ ] Tests verify duplicate user handling with processed_url_names
- [ ] Tests verify proper ordering by scanned_page_at field
- [ ] Tests verify 150 user batch limit handling
- [ ] All tests pass with good coverage
