From 94377ed3ea3cb5c69eccdefd27702999c997096a Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 16 Jan 2020 16:49:36 +0300 Subject: [PATCH] wizard company test --- tests/Feature/Wizard/CompaniesTest.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/Feature/Wizard/CompaniesTest.php diff --git a/tests/Feature/Wizard/CompaniesTest.php b/tests/Feature/Wizard/CompaniesTest.php new file mode 100644 index 000000000..4e43f77e4 --- /dev/null +++ b/tests/Feature/Wizard/CompaniesTest.php @@ -0,0 +1,37 @@ +loginAs() + ->get(route('wizard.companies.edit')) + ->assertStatus(200) + ->assertSeeText(trans('modules.api_key')); + } + + public function testItShouldUpdateCompany() + { + $request = $this->getRequest(); + + $this->loginAs() + ->patch(route('wizard.companies.update'), $request) + ->assertStatus(200); + + $this->assertFlashLevel('success'); + } + + public function getRequest() + { + return [ + 'financial_start' => '01-04', + 'address' => $this->faker->address, + 'tax_number' => $this->faker->randomNumber(9), + 'logo' => UploadedFile::fake()->create('image.jpg'), + ]; + } +}