Kaynağa Gözat

Try to fix TravisCI failing on route test

Bubka 5 yıl önce
ebeveyn
işleme
53ada0bfaa

+ 1 - 1
app/Http/Controllers/SinglePageController.php

@@ -15,6 +15,6 @@ class SinglePageController extends Controller
     {
         $appSettings = \Illuminate\Support\Facades\DB::table('options')->pluck('value', 'key')->toJson();
 
-        return view("landing")->with('appSettings', $appSettings);;
+        return view('landing')->with('appSettings', $appSettings);
     }
 }

+ 1 - 1
routes/web.php

@@ -16,4 +16,4 @@
 // });
 
 // Route::get('twofaccount/{TwoFAccount}', 'TwoFAccountController@show');
-Route::get('/{any}', 'SinglePageController@index')->where('any', '.*');
+Route::get('/{any}', 'SinglePageController@index')->where('any', '.*')->name('landing');

+ 3 - 2
tests/Unit/RouteTest.php

@@ -14,9 +14,10 @@ class RouteTest extends TestCase
      */
     public function testLandingViewIsReturned()
     {
-        $response = $this->get('/');
+        $response = $this->get(route('landing', ['any' => '']));
 
-        $response->assertViewIs('landing');
+        $response->assertSuccessful()
+            ->assertViewIs('landing');
     }
 
 }