@@ -399,6 +399,25 @@ public function test_it_handles_negative_min_option()
399
399
});
400
400
}
401
401
402
+ public function test_it_accepts_custom_queue_option ()
403
+ {
404
+ Queue::fake ();
405
+
406
+ SearchableUserFactory::new ()->count (10 )->create ();
407
+
408
+ $ this ->artisan ('scout:queue-import ' , [
409
+ 'model ' => SearchableUser::class,
410
+ '--queue ' => 'custom-queue ' ,
411
+ ])
412
+ ->expectsOutputToContain ('models up to ID: 10 ' )
413
+ ->expectsOutputToContain ('records have been queued ' )
414
+ ->assertSuccessful ();
415
+
416
+ Queue::assertPushedOn ('custom-queue ' , MakeRangeSearchable::class, function ($ job ) {
417
+ return $ job ->start == 1 && $ job ->end == 10 ;
418
+ });
419
+ }
420
+
402
421
public function test_it_can_accept_all_options ()
403
422
{
404
423
Queue::fake ();
@@ -410,6 +429,7 @@ public function test_it_can_accept_all_options()
410
429
'--min ' => 5 ,
411
430
'--max ' => 15 ,
412
431
'--chunk ' => 4 ,
432
+ '--queue ' => 'custom-queue ' ,
413
433
])
414
434
->expectsOutputToContain ('models up to ID: 8 ' )
415
435
->expectsOutputToContain ('models up to ID: 12 ' )
@@ -419,5 +439,17 @@ public function test_it_can_accept_all_options()
419
439
420
440
// Should dispatch 3 jobs: [5-8], [9-12], [13-15]
421
441
Queue::assertPushed (MakeRangeSearchable::class, 3 );
442
+
443
+ Queue::assertPushedOn ('custom-queue ' , MakeRangeSearchable::class, function ($ job ) {
444
+ return $ job ->start == 5 && $ job ->end == 8 ;
445
+ });
446
+
447
+ Queue::assertPushedOn ('custom-queue ' , MakeRangeSearchable::class, function ($ job ) {
448
+ return $ job ->start == 9 && $ job ->end == 12 ;
449
+ });
450
+
451
+ Queue::assertPushedOn ('custom-queue ' , MakeRangeSearchable::class, function ($ job ) {
452
+ return $ job ->start == 13 && $ job ->end == 15 ;
453
+ });
422
454
}
423
455
}
0 commit comments