-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ConfigTest.php
69 lines (52 loc) · 1.51 KB
/
ConfigTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
use Crater\Models\User;
use Illuminate\Support\Facades\Artisan;
use Laravel\Sanctum\Sanctum;
use function Pest\Laravel\getJson;
beforeEach(function () {
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
$user = User::find(1);
$this->withHeaders([
'company' => $user->companies()->first()->id,
]);
Sanctum::actingAs(
$user,
['*']
);
});
test('get all languages', function () {
$key = 'languages';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all fiscal years', function () {
$key = 'fiscal_years';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all convert estimate options', function () {
$key = 'convert_estimate_options';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all retrospective edits', function () {
$key = 'retrospective_edits';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all currency converter servers', function () {
$key = 'currency_converter_servers';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all exchange rate drivers', function () {
$key = 'exchange_rate_drivers';
getJson('api/v1/config?key='.$key)
->assertOk();
});
test('get all custom field models', function () {
$key = 'custom_field_models';
getJson('api/v1/config?key='.$key)
->assertOk();
});