Browse Source

Try to fix TravisCI failing on route test

Bubka 5 years ago
parent
commit
53ada0bfaa
3 changed files with 5 additions and 4 deletions
  1. 1 1
      app/Http/Controllers/SinglePageController.php
  2. 1 1
      routes/web.php
  3. 3 2
      tests/Unit/RouteTest.php

+ 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');
     }
 
 }