mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-13 13:52:48 +00:00
115 - Driving Out Basic Concert Updates
This commit is contained in:
@@ -131,4 +131,53 @@ class EditConcertTest extends TestCase
|
||||
$this->assertEquals(7250, $concert->ticket_price);
|
||||
});
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function promoters_cannot_edit_other_unpublished_concerts()
|
||||
{
|
||||
$user = factory(User::class)->create();
|
||||
$otherUser = factory(User::class)->create();
|
||||
$concert = factory(Concert::class)->create([
|
||||
'user_id' => $otherUser->id,
|
||||
'title' => 'Old title',
|
||||
'subtitle' => 'Old subtitle',
|
||||
'additional_information' => 'Old additional information',
|
||||
'date' => Carbon::parse('2017-01-01 5:00pm'),
|
||||
'venue' => 'Old venue',
|
||||
'venue_address' => 'Old address',
|
||||
'city' => 'Old city',
|
||||
'state' => 'Old state',
|
||||
'zip' => '00000',
|
||||
'ticket_price' => 2000,
|
||||
]);
|
||||
$this->assertFalse($concert->isPublished());
|
||||
|
||||
$response = $this->actingAs($user)->patch("/backstage/concerts/{$concert->id}", [
|
||||
'title' => 'New title',
|
||||
'subtitle' => 'New subtitle',
|
||||
'additional_information' => 'New additional information',
|
||||
'date' => '2018-12-12',
|
||||
'time' => '8:00pm',
|
||||
'venue' => 'New venue',
|
||||
'venue_address' => 'New address',
|
||||
'city' => 'New city',
|
||||
'state' => 'New state',
|
||||
'zip' => '99999',
|
||||
'ticket_price' => '72.50',
|
||||
]);
|
||||
|
||||
$response->assertStatus(404);
|
||||
tap($concert->fresh(), function ($concert) {
|
||||
$this->assertEquals('Old title', $concert->title);
|
||||
$this->assertEquals('Old subtitle', $concert->subtitle);
|
||||
$this->assertEquals('Old additional information', $concert->additional_information);
|
||||
$this->assertEquals(Carbon::parse('2017-01-01 5:00pm'), $concert->date);
|
||||
$this->assertEquals('Old venue', $concert->venue);
|
||||
$this->assertEquals('Old address', $concert->venue_address);
|
||||
$this->assertEquals('Old city', $concert->city);
|
||||
$this->assertEquals('Old state', $concert->state);
|
||||
$this->assertEquals('00000', $concert->zip);
|
||||
$this->assertEquals(2000, $concert->ticket_price);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user