13
13
use Biigle \Tests \ImageAnnotationTest ;
14
14
use Biigle \Tests \ImageTest ;
15
15
use Biigle \Tests \LabelTest ;
16
+ use Queue ;
16
17
17
18
class LaserpointsControllerTest extends ApiTestCase
18
19
{
@@ -37,13 +38,14 @@ public function testComputeImage()
37
38
38
39
$ this ->makeManualAnnotations ($ label , 3 );
39
40
40
- $ this ->expectsJobs (ProcessImageDelphiJob::class);
41
41
$ this ->postJson ("/api/v1/images/ {$ image ->id }/laserpoints/area " , [
42
42
'distance ' => 50 ,
43
43
'label_id ' => $ label ->id ,
44
44
])
45
45
->assertStatus (200 );
46
46
47
+ Queue::assertPushed (ProcessImageDelphiJob::class);
48
+
47
49
// Distance is required.
48
50
$ this ->postJson ("/api/v1/images/ {$ image ->id }/laserpoints/area " , [
49
51
'label_id ' => $ label ->id ,
@@ -82,12 +84,13 @@ public function testComputeImage()
82
84
$ this ->makeManualAnnotations ($ label , 2 , 1 );
83
85
$ image = Image::first ();
84
86
85
- $ this ->expectsJobs (ProcessImageManualJob::class);
86
87
$ this ->post ("/api/v1/images/ {$ image ->id }/laserpoints/area " , [
87
88
'distance ' => 50 ,
88
89
'label_id ' => $ label ->id ,
89
90
])
90
91
->assertStatus (200 );
92
+
93
+ Queue::assertPushed (ProcessImageManualJob::class);
91
94
}
92
95
93
96
public function testComputeImageRemote ()
@@ -99,12 +102,12 @@ public function testComputeImageRemote()
99
102
$ this ->makeManualAnnotations ($ label , 3 );
100
103
101
104
$ this ->beEditor ();
102
- $ this ->expectsJobs (ProcessImageDelphiJob::class);
103
105
$ this ->postJson ("/api/v1/images/ {$ image ->id }/laserpoints/area " , [
104
106
'distance ' => 50 ,
105
107
'label_id ' => $ label ->id ,
106
108
])
107
109
->assertStatus (200 );
110
+ Queue::assertPushed (ProcessImageDelphiJob::class);
108
111
}
109
112
110
113
public function testComputeImageTiled ()
@@ -114,12 +117,12 @@ public function testComputeImageTiled()
114
117
$ this ->makeManualAnnotations ($ label , 3 );
115
118
116
119
$ this ->beEditor ();
117
- $ this ->doesntExpectJobs (ProcessImageDelphiJob::class);
118
120
$ this ->postJson ("/api/v1/images/ {$ image ->id }/laserpoints/area " , [
119
121
'distance ' => 50 ,
120
122
'label_id ' => $ label ->id ,
121
123
])
122
124
->assertStatus (422 );
125
+ Queue::assertNotPushed (ProcessImageDelphiJob::class);
123
126
}
124
127
125
128
public function testComputeVolume ()
@@ -133,12 +136,12 @@ public function testComputeVolume()
133
136
134
137
$ this ->beEditor ();
135
138
$ this ->makeManualAnnotations ($ label , 3 );
136
- $ this ->expectsJobs (ProcessVolumeDelphiJob::class);
137
139
$ this ->postJson ("/api/v1/volumes/ {$ id }/laserpoints/area " , [
138
140
'distance ' => 50 ,
139
141
'label_id ' => $ label ->id ,
140
142
])
141
143
->assertStatus (200 );
144
+ Queue::assertPushed (ProcessVolumeDelphiJob::class);
142
145
}
143
146
144
147
public function testComputeVolumeValidation ()
@@ -203,12 +206,12 @@ public function testComputeVolumeRemote()
203
206
$ this ->makeManualAnnotations ($ label , 3 );
204
207
205
208
$ this ->beEditor ();
206
- $ this ->expectsJobs (ProcessVolumeDelphiJob::class);
207
209
$ this ->postJson ("/api/v1/volumes/ {$ id }/laserpoints/area " , [
208
210
'distance ' => 50 ,
209
211
'label_id ' => $ label ->id ,
210
212
])
211
213
->assertStatus (200 );
214
+ Queue::assertPushed (ProcessVolumeDelphiJob::class);
212
215
}
213
216
214
217
public function testComputeVolumeTiled ()
@@ -219,12 +222,12 @@ public function testComputeVolumeTiled()
219
222
$ this ->makeManualAnnotations ($ label , 3 );
220
223
221
224
$ this ->beEditor ();
222
- $ this ->doesntExpectJobs (ProcessVolumeDelphiJob::class);
223
225
$ this ->postJson ("/api/v1/volumes/ {$ id }/laserpoints/area " , [
224
226
'distance ' => 50 ,
225
227
'label_id ' => $ label ->id ,
226
228
])
227
229
->assertStatus (422 );
230
+ Queue::assertNotPushed (ProcessVolumeDelphiJob::class);
228
231
}
229
232
230
233
public function testComputeVideoVolume ()
0 commit comments