Fixed MembershipStoreAction
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Philipp Lang 2023-02-21 13:06:19 +01:00
parent 58fdfe1e81
commit 407338d431
2 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,7 @@ class MembershipStoreAction
'activity_id' => ['bail', 'required', 'exists:activities,id'], 'activity_id' => ['bail', 'required', 'exists:activities,id'],
'subactivity_id' => $subactivityRule, 'subactivity_id' => $subactivityRule,
'promised_at' => ['nullable', 'date'], 'promised_at' => ['nullable', 'date'],
'group_id' => ['required', 'exists:groups,id'],
]; ];
} }
@ -79,6 +80,7 @@ class MembershipStoreAction
return [ return [
'activity_id' => 'Tätigkeit', 'activity_id' => 'Tätigkeit',
'subactivity_id' => 'Untertätigkeit', 'subactivity_id' => 'Untertätigkeit',
'group_id' => 'Gruppierung',
]; ];
} }

View File

@ -179,6 +179,18 @@ class StoreTest extends TestCase
]); ]);
} }
public function testGroupIsRequired(): void
{
$member = Member::factory()->defaults()->for(Group::factory()->inNami(1400))->inNami(6)->create();
$response = $this->post(
"/member/{$member->id}/membership",
[],
);
$response->assertSessionHasErrors(['group_id' => 'Gruppierung ist erforderlich.']);
}
public function testSubactivityCanBeEmpty(): void public function testSubactivityCanBeEmpty(): void
{ {
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();