mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 08:00:19 +00:00
object group controller test
This commit is contained in:
@@ -100,7 +100,6 @@ final class CurrencyControllerTest extends TestCase {
|
||||
|
||||
// create test data
|
||||
$this->createTestCurrencies(10, true);
|
||||
$this->createTestCurrencies(5, false);
|
||||
|
||||
// test API
|
||||
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
|
||||
@@ -121,6 +120,22 @@ final class CurrencyControllerTest extends TestCase {
|
||||
$response->assertJsonCount(10);
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointDoesNotReturnDisabledCurrencies(): void
|
||||
{
|
||||
// act as a user
|
||||
$user = $this->createAuthenticatedUser();
|
||||
$this->actingAs($user);
|
||||
|
||||
// create test data
|
||||
$this->createTestCurrencies(10, false);
|
||||
|
||||
// test API
|
||||
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
|
||||
$response->assertStatus(200);
|
||||
$response->assertHeader('Content-Type', 'application/json');
|
||||
$response->assertJsonCount(0);
|
||||
}
|
||||
|
||||
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void
|
||||
{
|
||||
// act as a user
|
||||
@@ -168,5 +183,4 @@ final class CurrencyControllerTest extends TestCase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user