]> BookStack Code Mirror - bookstack/blobdiff - tests/Settings/SettingsTest.php
Added test to cover export body start/end partial usage
[bookstack] / tests / Settings / SettingsTest.php
index 5d8c36996c7fd0c09eeced990c6e5b803a74952e..e2ac6f27c5c24fb7ead7aa21a5707c879f041c36 100644 (file)
@@ -10,22 +10,26 @@ class SettingsTest extends TestCase
     {
         $resp = $this->asAdmin()->get('/settings');
 
-        $resp->assertRedirect('/settings/features');
+        $resp->assertStatus(302);
+
+        // Manually check path to ensure it's generated as the full path
+        $location = $resp->headers->get('location');
+        $this->assertEquals(url('/settings/features'), $location);
     }
 
     public function test_settings_category_links_work_as_expected()
     {
         $this->asAdmin();
         $categories = [
-            'features' => 'Features & Security',
+            'features'      => 'Features & Security',
             'customization' => 'Customization',
-            'registration' => 'Registration',
+            'registration'  => 'Registration',
         ];
 
         foreach ($categories as $category => $title) {
             $resp = $this->get("/settings/{$category}");
-            $resp->assertElementContains('h1', $title);
-            $resp->assertElementExists("form[action$=\"/settings/{$category}\"]");
+            $this->withHtml($resp)->assertElementContains('h1', $title);
+            $this->withHtml($resp)->assertElementExists("form[action$=\"/settings/{$category}\"]");
         }
     }
 
@@ -36,4 +40,4 @@ class SettingsTest extends TestCase
         $resp->assertStatus(404);
         $resp->assertSee('Page Not Found');
     }
-}
\ No newline at end of file
+}