.vbw-planning/milestones/07-rails-audit-and-refactoring/07-rails-audit-round-2/05-PLAN.md
Key context: 7 pagination tests in sources_controller_test.rb call Source.destroy_all for a clean slate, violating the project's own parallel-safety rules documented in TEST_CONVENTIONS.md. With thread-based parallelism, this races with other test threads. FetchLogsController and ScrapeLogsController have no test files. FeedFetcher has 12 forwarding methods and ItemCreator has 18 -- remnants from Phase 3/4 sub-module extraction. </context> <tasks> <task type="auto"> <name>Fix pagination test parallel-safety (H6)</name> <files> test/controllers/source_monitor/sources_controller_test.rb </files> <action>
Source.destroy_all (approximately 7 tests around lines 252-322).destroy_all approach with scoped assertions:
"PaginationTest-#{n}")assert_select to check for specific record content rather than counting total rowsSourcesPaginationTest that uses clean_source_monitor_tables! in setup (this is the documented safe approach for tests that need blank-slate counting).Note: ImportHistory model test is handled by Plan 01 (L12 task). Check existing routes to determine what actions these controllers support (likely just index/show). Use the engine's integration test patterns. </action> <verify> PARALLEL_WORKERS=1 bin/rails test test/controllers/source_monitor/fetch_logs_controller_test.rb test/controllers/source_monitor/scrape_logs_controller_test.rb </verify> <done> Two new controller test files exist with basic coverage. All pass. </done> </task> <task type="auto"> <name>Consolidate duplicated test helpers (L28)</name> <files> test/test_helper.rb </files> <action>
configure_authentication helper. Extract it to test_helper.rb or to test/support/ module.