Утвердить статус в Laravel Dusk - PullRequest
0 голосов
/ 22 марта 2019

У меня есть тест, который проверяет статус. Должно быть 200

Когда я запускаю это

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

Это проходит, но когда я добавляю URL: / клиентов всегда статус 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 ]

0 голосов
/ 22 марта 2019

измените route.php, как показано ниже. Я добавил маршрут `/ clients 'в ti.

<?php


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

   });

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

   });
0 голосов
/ 22 марта 2019
<?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');

});
...