/** * @test */ public function it_allows_create_entry() { $adminUser = User::first(); $this->actingAs($adminUser); $controller = $this->getControllerClass(); // get create url $urlBuilder = new UrlBuilder($controller, $this->getUrlParameters()); $url = $urlBuilder->getUrlCreate(); // call $this->visit($url); // fill the form foreach ($this->getCreateFormValues() as $values) { $this->type($values['text'], $values['element']); } // check $this->press($this->getCreateButtonText())->see('alert-success'); }
/** * @test */ public function it_allows_create_entry_with_gif_file() { $adminUser = User::first(); $this->actingAs($adminUser); $controller = $this->getControllerClass(); // get create url $urlBuilder = new UrlBuilder($controller, $this->getUrlParameters()); $url = $urlBuilder->getUrlCreate(); // call $this->visit($url); // fill the form $this->type($this->gifFilepath, 'file'); // check $this->press($this->getCreateButtonText())->see('alert-success'); }