Skip to content

Commit 576fe8e

Browse files
committed
Minor test fixes
1 parent b8d1fa2 commit 576fe8e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/Controller/App/ImportControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function testDatelessImportActionResponse(): void
6666

6767
public function testImportWithPrivateDefaults(): void
6868
{
69-
Setting::create(['user_id' => 1, 'key' => 'links_private_default', 'value' => '1']);
70-
Setting::create(['user_id' => 1, 'key' => 'tags_private_default', 'value' => '1']);
69+
Setting::updateOrCreate(['user_id' => 1, 'key' => 'links_private_default'], ['value' => '1']);
70+
Setting::updateOrCreate(['user_id' => 1, 'key' => 'tags_private_default'], ['value' => '1']);
7171

7272
$response = $this->importBookmarks();
7373

tests/Controller/App/SystemSettingsControllerTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use App\Models\User;
66
use Illuminate\Foundation\Testing\RefreshDatabase;
7+
use Illuminate\Support\Facades\Cache;
8+
use Illuminate\Support\Facades\Config;
79
use Tests\TestCase;
810

911
class SystemSettingsControllerTest extends TestCase
@@ -32,16 +34,13 @@ public function testValidSettingsResponse(): void
3234

3335
public function testValidSettingsUpdateResponse(): void
3436
{
35-
$response = $this->get('dashboard');
36-
$response->assertDontSee('Begin of custom header scripts');
37+
$this->get('dashboard')->assertDontSee('Begin of custom header scripts');
3738

38-
$response = $this->post('settings/system', [
39+
$this->post('settings/system', [
3940
'system_page_title' => 'New Title',
4041
'system_guest_access' => '1',
4142
'system_custom_header_content' => '<script>console.log(\'scripts work\')</script>',
42-
]);
43-
44-
$response->assertRedirect('settings/system');
43+
])->assertRedirect('settings/system')->assertSessionHasNoErrors();
4544

4645
$this->assertDatabaseHas('settings', [
4746
'user_id' => null,

0 commit comments

Comments
 (0)