Skip to content

Commit

Permalink
Comment assert that may not work
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviqv committed Feb 10, 2019
1 parent b0175de commit d6401bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions tests/PanicHDTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,25 @@ public function load_vars()
}

if (is_null($this->member)){
// TODO: Generate fake user
if (Member::users()->count() > 0){
$this->member = Member::whereHas('tickets', function($query){ $query->notHidden(); })->inRandomOrder()->users()->first();
if (!is_null($this->member)){
$this->member_tickets_builder = $this->member->tickets()->inRandomOrder();
// TODO: Generate fake tickets
$this->member_tickets_builder = $this->member->tickets()->inRandomOrder();
}
}
}

if (is_null($this->agent)){
if (Member::agents()->count() > 0){
// TODO: Generate fake agent
if (Member::agents()->count() > 0){
$this->agent = Member::whereHas('agentTickets')->inRandomOrder()->agents()->first();
}
}

if (is_null($this->admin)){
// TODO: Generate fake admin
if (Member::admins()->count() > 0){
$this->admin = Member::inRandomOrder()->admins()->first();
}
Expand Down
6 changes: 4 additions & 2 deletions tests/TicketsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ public function testTicketShowEdit()
$ticket = $ticket->notHidden()->first();
$response = $this->actingAs($this->member)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
$this->versionAssertStatus($response, 200);
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
$this->versionAssertStatus($response, 302);
/*
// TODO: Ensure to generate a fake user that doesn't have edit permissions on the aimed ticket
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
$this->versionAssertStatus($response, 302);*/

// Hidden ticket without $this->member in notifications
$ticket = clone $this->member_tickets_builder;
Expand Down

0 comments on commit d6401bc

Please sign in to comment.