@@ -538,15 +538,16 @@ func TestPostgresStore_GetAllPurchaseHistory_NilDB(t *testing.T) {
538538 assert .True (t , panicked , "expected panic with nil db connection" )
539539}
540540
541- // TestSaveGlobalConfig_OfferingClassBindsAt21 is the HOLE 2 regression guard
541+ // TestSaveGlobalConfig_OfferingClassBindsAt22 is the HOLE 2 regression guard
542542// (issue #694): the real PostgresStore.SaveGlobalConfig must bind offering_class
543- // as the 21st positional argument ($21). The testablePostgresStore in
544- // store_postgres_mock_test.go is a hand-maintained copy that omits the field
545- // entirely, so no fast test guarded the placeholder count until now.
543+ // as the 22nd positional argument ($22), with laddering_enabled at $21.
544+ // The testablePostgresStore in store_postgres_mock_test.go is a hand-maintained
545+ // copy that omits the field entirely, so no fast test guarded the placeholder
546+ // count until now.
546547//
547548// Using pgxmock directly against the real PostgresStore (not the hand-maintained
548549// testablePostgresStore wrapper) ensures the live query is tested, not a stale copy.
549- func TestSaveGlobalConfig_OfferingClassBindsAt21 (t * testing.T ) {
550+ func TestSaveGlobalConfig_OfferingClassBindsAt22 (t * testing.T ) {
550551 ctx := context .Background ()
551552 mock , err := pgxmock .NewPool ()
552553 require .NoError (t , err )
@@ -568,8 +569,8 @@ func TestSaveGlobalConfig_OfferingClassBindsAt21(t *testing.T) {
568569 OfferingClass : "standard" ,
569570 }
570571
571- // Expect exactly 21 args; pgxmock validates arg count and types.
572- // The 21st arg must be the string "standard" (offering_class).
572+ // Expect exactly 22 args; pgxmock validates arg count and types.
573+ // The 21st arg is laddering_enabled; the 22nd arg must be "standard" (offering_class).
573574 // If the real query regresses to a different arg count, pgxmock
574575 // will return an unexpected-call error and the test will fail.
575576 mock .ExpectExec (`INSERT INTO global_config` ).
@@ -594,13 +595,14 @@ func TestSaveGlobalConfig_OfferingClassBindsAt21(t *testing.T) {
594595 pgxmock .AnyArg (), // $18 recommendations_cache_stale_hours
595596 pgxmock .AnyArg (), // $19 recommendations_lookback_days
596597 pgxmock .AnyArg (), // $20 purchase_delay_hours
597- "standard" , // $21 offering_class -- the field this test guards
598+ pgxmock .AnyArg (), // $21 laddering_enabled
599+ "standard" , // $22 offering_class -- the field this test guards
598600 ).
599601 WillReturnResult (pgxmock .NewResult ("INSERT" , 1 ))
600602
601603 err = store .SaveGlobalConfig (ctx , cfg )
602- require .NoError (t , err , "SaveGlobalConfig must succeed when the DB accepts all 21 args" )
604+ require .NoError (t , err , "SaveGlobalConfig must succeed when the DB accepts all 22 args" )
603605
604606 require .NoError (t , mock .ExpectationsWereMet (),
605- "offering_class must be bound as the 21st argument to SaveGlobalConfig" )
607+ "offering_class must be bound as the 22nd argument to SaveGlobalConfig" )
606608}
0 commit comments