Hello Laracaster, how I can test this???
it('dispatch and user and change his name', function () {
UserName::dispatch($this->user, 'Andrew');
$newName = $this->user->refresh()->name;
expect($newName)->toBe("Andrew");
});
So far it works, but this is the thing I can't wrap my head on
1- I can't work on my TEST-DB, I got to work in my official DB thus Redis is pointing there... so that's an issue
2- when I run the test the first time, it gives an error, because it dispatches the job, and continues the execution, so on the second run of course it passes because Redis already took the job a make the change of the name... so, what I want is to test this the right way it should... hope this makes sense, on execution know that this pass and do the magic... how to, thanks in advance