Testing Job Dispatch0:00
So far, so good. What else do we have to do now here? So we are now, if the request is valid, we're going to send it to a job. So this means now I want to make sure that a specific Job is being dispatched for a valid request. So let's also do this here. It dispatches a Job for valid pedal request. And this also means we want to do the same kind of check if it's not a valid request. Copy this. It does not dispatch a Job for invalid pedal request. All right, how are we going to start here? We start here by faking our queuing system.
Faking Queue and Request0:42
All right, how are we going to start here? We start here by faking our queuing system. And then we're going to make a request like this one here. We're going to copy the whole chunk here. We're going to deal with that later. For now, we just want to make it work. Here we're going to act. Here we're going to send this. And now we're making sure that a specific job was being sent. assertPushedHandlePedalPurchaseJob. And we're providing the class.
Asserting No Job Pushed1:14
assertPushedHandlePedalPurchaseJob. And we're providing the class. So actually this should already work. And it does. All right, cool. Then let's copy the whole content again for the second one here. Here we're just going to switch out the array with an empty one. And we want to make sure that assertNothingWasPushed is also a method. Here we don't need to provide anything. We are faking the system. We're making a request with an invalid request.
We are faking the system. We're making a request with an invalid request. And we make sure that nothing has been pushed to our queuing system. And this should also work. And it does. Awesome. So we already have here four tests. We're making sure that we can store a valid request. It does not store an invalid request. We're making sure that a job is being dispatched for a valid request. And it's not being dispatched for an invalid request. And as always, at the end of every video,
Running Full Test Suite2:07
And it's not being dispatched for an invalid request. And as always, at the end of every video, let's make sure that we're going to run all the tests to make sure we didn't break anything. And it looks good. 68 tests already, almost 70, which is amazing. I really love that we already have so many tests and way more assertion inside this application. And then in the next video, we want to make sure that we're actually doing something inside our job.
Planning Job Implementation2:30
And then in the next video, we want to make sure that we're actually doing something inside our job. So we're probably going to need to store a User, maybe add a Product and things like that.
