mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-25 18:20:38 +00:00
added it_get_public_file_record_and_download_them, it_try_to_get_protected_file_record, it_get_shared_record, it_get_deleted_shared_record, it_get_shared_page, it_get_deleted_shared_page test
This commit is contained in:
@@ -237,5 +237,68 @@ class ShareTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
// TODO: napisat testy pre FileSharingController
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_shared_record()
|
||||
{
|
||||
$share = Share::factory(Share::class)
|
||||
->create([
|
||||
'is_protected' => 0,
|
||||
]);
|
||||
|
||||
$this->get("/api/shared/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
'data' => [
|
||||
'id' => $share->id,
|
||||
'type' => 'shares',
|
||||
'attributes' => [
|
||||
'permission' => $share->permission,
|
||||
'is_protected' => '0',
|
||||
'item_id' => $share->item_id,
|
||||
'expire_in' => $share->expire_in,
|
||||
'token' => $share->token,
|
||||
'link' => $share->link,
|
||||
'type' => $share->type,
|
||||
'created_at' => $share->created_at->toJson(),
|
||||
'updated_at' => $share->updated_at->toJson(),
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_deleted_shared_record()
|
||||
{
|
||||
$this->get("/api/shared/19ZMPNiass4ZqWwQ")
|
||||
->assertNotFound();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_shared_page()
|
||||
{
|
||||
$share = Share::factory(Share::class)
|
||||
->create([
|
||||
'type' => 'file',
|
||||
'is_protected' => false,
|
||||
]);
|
||||
|
||||
$this->get("/shared/$share->token")
|
||||
->assertViewIs('index')
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_deleted_shared_page()
|
||||
{
|
||||
$this->get('/shared/19ZMPNiass4ZqWwQ')
|
||||
->assertNotFound();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user