]> BookStack Code Mirror - bookstack/blob - tests/Settings/SettingsTest.php
Split out settings view and made functional
[bookstack] / tests / Settings / SettingsTest.php
1 <?php
2
3 namespace Tests\Settings;
4
5 use Tests\TestCase;
6
7 class SettingsTest extends TestCase
8 {
9     public function test_settings_endpoint_redirects_to_settings_view()
10     {
11         $resp = $this->asAdmin()->get('/settings');
12
13         $resp->assertRedirect('/settings/features');
14     }
15
16     public function test_settings_category_links_work_as_expected()
17     {
18         $this->asAdmin();
19         $categories = [
20             'features' => 'Features & Security',
21             'customization' => 'Customization',
22             'registration' => 'Registration',
23         ];
24
25         foreach ($categories as $category => $title) {
26             $resp = $this->get("/settings/{$category}");
27             $resp->assertElementContains('h1', $title);
28             $resp->assertElementExists("form[action$=\"/settings/{$category}\"]");
29         }
30     }
31 }