mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 20:36:43 +00:00
Fix test coverage.
This commit is contained in:
@@ -66,16 +66,6 @@ class PreferencesControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testShow(): void
|
||||
{
|
||||
/** @var Preference $preference */
|
||||
$preference = $this->user()->preferences()->first();
|
||||
|
||||
$response = $this->get('/api/v1/preferences/' . $preference->id);
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee($preference->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\PreferenceController
|
||||
* @covers \FireflyIII\Api\V1\Requests\PreferenceRequest
|
||||
@@ -85,7 +75,7 @@ class PreferencesControllerTest extends TestCase
|
||||
/** @var Preference $preference */
|
||||
$preference = Preferences::setForUser($this->user(), 'frontPageAccounts', [1, 2, 3]);
|
||||
$data = ['data' => '4,5,6'];
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->id, $data, ['Accept' => 'application/json']);
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->name, $data, ['Accept' => 'application/json']);
|
||||
$response->assertSee($preference->name);
|
||||
$response->assertStatus(200);
|
||||
|
||||
@@ -100,7 +90,7 @@ class PreferencesControllerTest extends TestCase
|
||||
/** @var Preference $preference */
|
||||
$preference = Preferences::setForUser($this->user(), 'twoFactorAuthEnabled', false);
|
||||
$data = ['data' => '1'];
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->id, $data, ['Accept' => 'application/json']);
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->name, $data, ['Accept' => 'application/json']);
|
||||
$response->assertSee($preference->name);
|
||||
$response->assertStatus(200);
|
||||
|
||||
@@ -115,7 +105,7 @@ class PreferencesControllerTest extends TestCase
|
||||
/** @var Preference $preference */
|
||||
$preference = Preferences::setForUser($this->user(), 'currencyPreference', false);
|
||||
$data = ['data' => 'EUR'];
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->id, $data, ['Accept' => 'application/json']);
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->name, $data, ['Accept' => 'application/json']);
|
||||
$response->assertSee($preference->name);
|
||||
$response->assertStatus(200);
|
||||
|
||||
@@ -130,7 +120,7 @@ class PreferencesControllerTest extends TestCase
|
||||
/** @var Preference $preference */
|
||||
$preference = Preferences::setForUser($this->user(), 'listPageSize', 13);
|
||||
$data = ['data' => '434'];
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->id, $data, ['Accept' => 'application/json']);
|
||||
$response = $this->put('/api/v1/preferences/' . $preference->name, $data, ['Accept' => 'application/json']);
|
||||
$response->assertSee($preference->name);
|
||||
$response->assertStatus(200);
|
||||
|
||||
|
Reference in New Issue
Block a user