/** * Arrange Fixture. * * @return void */ protected function arrangeFixture() { // Given there is... // a Business owned by Me (User) $this->owner = $this->createUser(); $this->issuer = $this->createUser(); $this->business = $this->createBusiness(); $this->business->owners()->save($this->owner); // And the Business provides a Service $this->service = $this->makeService(); $this->business->services()->save($this->service); // And the Service has Vacancies to be reserved $this->vacancy = $this->makeVacancy(); $this->vacancy->service()->associate($this->service); $this->business->vacancies()->save($this->vacancy); // And a Contact that holds an Appointment for that Service $this->contact = $this->createContact(); }
/** * @test */ public function it_updates_the_vacancy_in_simple_mode() { $this->arrangeBusinessWithOwner(); $this->actingAs($this->vacancy->business->owner()); $this->visit(route('manager.business.vacancy.create', $this->vacancy->business)); $newCapacity = $this->vacancy->capacity + 5; $this->type($newCapacity, "vacancy[{$this->vacancy->date}][{$this->vacancy->service->id}]"); $this->press('Update'); $this->assertEquals($this->vacancy->fresh()->capacity, $newCapacity); }