login()->loginNami(); $member = Member::factory()->defaults()->for(Group::factory()->inNami(32))->inNami(33)->create(); PullMemberAction::shouldRun()->once()->with(32, 33)->andReturn($member); PullMembershipsAction::shouldRun()->once()->with($member); PullCoursesAction::shouldRun()->never(); $response = $this->from('/member')->get(route('member.resync', ['member' => $member])); $response->assertRedirect('/member'); } public function testItReturnsErrorWhenMemberIsNotInNami(): void { $this->login()->loginNami(); $member = Member::factory()->defaults()->create(); PullMemberAction::shouldRun()->never(); PullMembershipsAction::shouldRun()->never(); PullCoursesAction::shouldRun()->never(); $response = $this->from('/member')->get(route('member.resync', ['member' => $member])); $response->assertRedirect('/member'); } }