Skip to content

Commit

Permalink
Increase code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Dec 19, 2023
1 parent 31a1ca6 commit 93d7f5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/Feature/Events/APIv2EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,22 @@ public function testEmptyNetworkData() {
$json = json_decode($response->getContent(), true);
assertEquals(null, $json['data']['network_data']);
}

public function testNetworkCoordinatorCanApprove() {
$network = Network::factory()->create();
$group = Group::factory()->create();
$network->addGroup($group);

$event = Party::factory()->create(['group' => $group->idgroups]);
$event->save();

$coordinator = User::factory()->networkCoordinator()->create();
$network->addCoordinator($coordinator);
$this->actingAs($coordinator);

$eventData = $event->getAttributes();
$eventData['moderate'] = 'approve';
$response = $this->patch('/api/v2/events/'.$event->idevents, $this->eventAttributesToAPI($eventData));
$response->assertSuccessful();
}
}

0 comments on commit 93d7f5c

Please sign in to comment.