/**
  * @test
  */
 public function canRegisterAFamilyAsGuestWithFees()
 {
     $this->simulateTransaction();
     $shirtSize = 'XL';
     $tournament = Tournament::firstOrFail();
     $playerFirstName = 'Mark';
     $firstName = 'John';
     $lastName = 'Smith';
     $email = 'testuser' . time() . '@example.com';
     $street = '123 Test Street';
     $spouseFirstName = 'apples';
     $this->visit('/tournaments/' . $tournament->slug . '/registration/spectator')->type($firstName, 'first_name')->type($lastName, 'last_name')->type($email, 'email')->press('Continue')->see('The street address field is required')->see('The zip code field is required')->type($street, 'address_one')->type('12345', 'zip_code')->select($shirtSize, 'shirt_size')->type($spouseFirstName, 'spouse_first_name')->type($playerFirstName, 'minor[1][first_name]')->press('Continue')->seePageIs('/cart')->see('Family Tournament Registration')->press('Submit')->see('Your registration is complete');
     $spectator = Spectator::orderBy('id', 'desc')->first();
     $this->assertEquals($shirtSize, $spectator->shirt_size);
     // defaults to no group selected
     $this->assertNull($spectator->group_id);
     $this->assertEquals($firstName, $spectator->first_name);
     $this->assertEquals($lastName, $spectator->last_name);
     $this->assertEquals($email, $spectator->email);
     $this->assertEquals($spouseFirstName, $spectator->spouse_first_name);
     // we use the receipt_id to determine if payment has been made
     $this->assertGreaterThan(0, $spectator->receipt_id);
     // verify address is populated
     $this->assertEquals($street, $spectator->address->address_one);
     // assert minor is there
     $this->assertEquals($playerFirstName, $spectator->minors()->first()->name);
 }
 /**
  * @test
  */
 public function cantRegisterAsGuest()
 {
     // assert there's a button on the page and we can't click it
     $this->expectException(LogicException::class);
     $this->expectExceptionMessage('The selected node does not have a form ancestor');
     $tournament = Tournament::firstOrFail();
     $this->visit('/tournaments/' . $tournament->slug)->press('Quizmaster');
     // asserts it's a button
 }
Exemple #3
0
 /**
  * @test
  */
 public function isRedirectedAfterLogin()
 {
     $tournament = Tournament::firstOrFail();
     $this->visit('/login?returnUrl=tournaments/' . $tournament->slug)->login(AcceptanceTestingSeeder::GUARDIAN_EMAIL, AcceptanceTestingSeeder::GUARDIAN_PASSWORD)->followRedirects()->seePageIs('/tournaments/' . $tournament->slug);
 }
 /**
  * @test
  */
 public function suggestsOnsiteRegistration()
 {
     $tournament = Tournament::firstOrFail();
     $tournament->update(['registration_start' => Carbon::now()->subDays(10)->format('m/d/Y'), 'registration_end' => Carbon::now()->subDays(1)->format('m/d/Y')]);
     $this->visit('/tournaments/' . $tournament->slug)->see('Quizmaster, Adult and Family registrations will be accepted onsite.');
 }
 /**
  * @test
  */
 public function cantAddSpectatorsWhenRegistrationClosed()
 {
     $tournament = Tournament::firstOrFail();
     $tournament->update(['registration_start' => Carbon::now()->subDays(10)->format('m/d/Y'), 'registration_end' => Carbon::now()->subDays(1)->format('m/d/Y')]);
     $this->visit('/tournaments/' . $tournament->slug . '/group')->dontSee('Add Adult/Family');
 }