mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
add upload invoice and test
This commit is contained in:
@@ -107,11 +107,10 @@ class BookingTest extends TestCase
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->json('POST', '/api/booking/' . $this->booking->id . '/upload-po', [
|
||||
'file' => UploadedFile::fake()->image('comp.jpg'),
|
||||
'file' => $image_url,
|
||||
'amount' => '12345'
|
||||
])
|
||||
->assertSuccessful();
|
||||
|
||||
}
|
||||
|
||||
public function testCancel()
|
||||
@@ -128,7 +127,6 @@ class BookingTest extends TestCase
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
|
||||
public function testRejectBankSlip()
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
@@ -137,4 +135,24 @@ class BookingTest extends TestCase
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
// Only this is Admin permision required
|
||||
public function testUploadInvoice(){
|
||||
$this->user->roles()->sync([]);
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
|
||||
Storage::fake('invoice_url');
|
||||
$invoice_url = UploadedFile::fake()->create('document.pdf');
|
||||
|
||||
if(!file_exists($invoice_url)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->json('POST', '/api/booking/' . $this->booking->id . '/upload-invoice', [
|
||||
'invoice_url' => $invoice_url,
|
||||
'amount' => '12345'
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user