-1

I have a test which verify status. It should be 200

When I run this

public function testBasicTest()
{
    $response = $this->json('GET', '/');
    $response->assertStatus(200);
}

It pass but when I add url: /clients always status 404

public function testBasicTest()
{
    $response = $this->json('GET', '/clients');
    $response->assertStatus(200);
}

Error: 
Expected status code 200 but received 404.
Failed asserting that false is true.

2 Answers2

0

change your route.php like below. I added `/clients' route in ti.

<?php


   Route::get('/', function () {
      return view('welcome');

   });

   Route::get('/clients', function () {
      return view('welcome');

   });
Sandeep Sudhakaran
  • 1,072
  • 2
  • 9
  • 22
-1
<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');

});