mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
controller refactoring part 13
This commit is contained in:
@@ -424,67 +424,4 @@ class AdminTest extends TestCase
|
||||
Storage::disk('local')
|
||||
->assertMissing($user->settings->getRawOriginal('avatar'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_all_pages()
|
||||
{
|
||||
$this->setup->seed_default_pages();
|
||||
|
||||
$admin = User::factory(User::class)
|
||||
->create(['role' => 'admin']);
|
||||
|
||||
Sanctum::actingAs($admin);
|
||||
|
||||
collect(['terms-of-service', 'privacy-policy', 'cookie-policy'])
|
||||
->each(function ($slug) {
|
||||
$this->getJson('/api/admin/pages')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'slug' => $slug,
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_page()
|
||||
{
|
||||
$this->setup->seed_default_pages();
|
||||
|
||||
$admin = User::factory(User::class)
|
||||
->create(['role' => 'admin']);
|
||||
|
||||
$this
|
||||
->actingAs($admin)
|
||||
->getJson('/api/admin/pages/terms-of-service')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'slug' => 'terms-of-service',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_update_page()
|
||||
{
|
||||
$this->setup->seed_default_pages();
|
||||
|
||||
$admin = User::factory(User::class)
|
||||
->create(['role' => 'admin']);
|
||||
|
||||
$this
|
||||
->actingAs($admin)
|
||||
->patchJson('/api/admin/pages/terms-of-service', [
|
||||
'name' => 'title',
|
||||
'value' => 'New Title',
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'title' => 'New Title',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user