/**
  * @test
  */
 public function canRegisterWithGroupAndWithoutFees()
 {
     $this->setupAsGuardian();
     $this->simulateTransaction();
     $tournament = Tournament::firstOrFail();
     // Remove fees for quizmasters
     $tournament->participantFees()->where('participant_type_id', ParticipantType::ADULT)->update(['earlybird_fee' => 0, 'fee' => 0]);
     $group = Group::byProgram($tournament->program_id)->first();
     $this->visit('/tournaments/' . $tournament->slug . '/registration/spectator')->select($group->id, 'group_id')->press('Submit')->see('Your registration is complete');
     $spectator = Spectator::orderBy('id', 'desc')->first();
     $this->assertEquals($group->id, $spectator->group_id);
     // no payment was made, so we shouldn't have a receipt
     $this->assertNull($spectator->receipt_id);
 }
 /**
  * @test
  */
 public function canRegisterWithGroupAndWithoutFees()
 {
     $this->setupAsGuardian();
     $this->simulateTransaction();
     $gamesQuizzedThisSeason = 'Fewer than 30';
     $tournament = Tournament::firstOrFail();
     // Remove fees for quizmasters
     $tournament->participantFees()->where('participant_type_id', ParticipantType::QUIZMASTER)->update(['earlybird_fee' => 0, 'fee' => 0]);
     $group = Group::byProgram($tournament->program_id)->first();
     $this->visit('/tournaments/' . $tournament->slug . '/registration/quizmaster')->select($group->id, 'group_id')->select($gamesQuizzedThisSeason, 'games_quizzed_this_season')->press('Submit')->see('Your quizmaster registration is complete');
     $quizmaster = TournamentQuizmaster::orderBy('id', 'desc')->first();
     $this->assertEquals($group->id, $quizmaster->group_id);
     // quizzing preferences saved
     $this->assertEquals($gamesQuizzedThisSeason, $quizmaster->quizzing_preferences->gamesQuizzedThisSeason());
     // no payment was made, so we shouldn't have a receipt
     $this->assertNull($quizmaster->receipt_id);
 }