Level 56
@xiatesting at least we need to know what '/categories' url returns. It's view with displayed categories? It's json object? How it's structured? Please, provide more details about endpoint response
Here is my test, I use factory first to create some categories, then hit the endpoint /categories , but I don't know how to test if I get the same number of categories, and also in my test I am not approaching my $response from the endpoint.
public function test_it_can_retrive_list_of_categories()
{
Category::factory()->count(5)->create();
$response = $this->get('/categories');
$this->assertDatabaseCount($this->table, 5); // Don't know how to test.
}
Any help would be appreciated
Please or to participate in this conversation.