/** * @test */ public function canCreateTournament() { $name = 'My Tournament ' . time(); $soon = Carbon::now()->addMonths(1)->format('m/d/Y'); $this->visit('/admin/tournaments/create')->type($name, 'name')->press('Save')->see('A registration start date is required')->type($soon, 'start')->type($soon, 'end')->type($soon, 'registration_start')->type($soon, 'registration_end')->type(24, 'max_teams')->type(33.3, 'participantTypes[' . ParticipantType::PLAYER . '][earlybird_fee]')->type(25.5, 'participantTypes[' . ParticipantType::PLAYER . '][fee]')->type(45.3, 'participantTypes[' . ParticipantType::PLAYER . '][onsite_fee]')->check('participantTypes[3][requireRegistration]')->press('Save')->seePageIs('/admin/tournaments')->see($name); $tournament = Tournament::orderBy('id', 'desc')->firstOrFail(); $playerFees = $tournament->participantFees()->where('participant_type_id', ParticipantType::PLAYER)->first(); $this->assertEquals('33.30', $playerFees->earlybird_fee); $this->assertEquals('25.50', $playerFees->fee); $this->assertEquals('45.30', $playerFees->onsite_fee); }