diff --git a/app/Ninja/Repositories/ProposalSnippetRepository.php b/app/Ninja/Repositories/ProposalSnippetRepository.php index dbb52b98690a..5a413815c3d4 100644 --- a/app/Ninja/Repositories/ProposalSnippetRepository.php +++ b/app/Ninja/Repositories/ProposalSnippetRepository.php @@ -67,11 +67,6 @@ class ProposalSnippetRepository extends BaseRepository } $proposal->fill($input); - - if (isset($input['proposal_category_id'])) { - $proposal->proposal_category_id = $input['proposal_category_id'] ? ProposalCategory::getPrivateId($input['proposal_category_id']) : null; - } - $proposal->save(); return $proposal; diff --git a/docs/install.rst b/docs/install.rst index f6a835348620..bd1f232c751f 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -19,7 +19,7 @@ Detailed Guides Automated Installers ^^^^^^^^^^^^^^^^^^^^ -- Dockerfile: `github.com/invoiceninja/dockerfiles `_ +- Dockerfile: `github.com `_ - Cloudron: `cloudron.io `_ diff --git a/tests/acceptance/QuoteCest.php b/tests/acceptance/QuoteCest.php index bfdfbff4b951..e4dfa641b2c3 100644 --- a/tests/acceptance/QuoteCest.php +++ b/tests/acceptance/QuoteCest.php @@ -20,8 +20,37 @@ class QuoteCest { $clientEmail = $this->faker->safeEmail; $productKey = $this->faker->text(10); + $categoryName = $this->faker->text(11); + $snippetName = $this->faker->text(12); + $templateName = $this->faker->text(13); - $I->wantTo('create a quote'); + $I->wantTo('create a quote and proposal'); + + // create proposal category + $I->amOnPage('/proposals/categories/create'); + $I->fillField(['name' => 'name'], $categoryName); + $I->click('Save'); + $I->see('Successfully created category'); + $I->amOnPage('/proposals/categories'); + $I->see($categoryName); + + // create proposal snippet + $I->amOnPage('/proposals/snippets/create'); + $I->fillField(['name' => 'name'], $snippetName); + $I->selectDropdown($I, $categoryName, '.category-select .dropdown-toggle'); + $I->click('Save'); + $I->see('Successfully created snippet'); + $I->amOnPage('/proposals/snippets'); + $I->see($snippetName); + $I->see($categoryName); + + // create proposal template + $I->amOnPage('/proposals/templates/create'); + $I->fillField(['name' => 'name'], $templateName); + $I->click('Save'); + $I->see('Successfully created template'); + $I->amOnPage('/proposals/templates'); + $I->see($templateName); // create client $I->amOnPage('/clients/create'); @@ -35,8 +64,7 @@ class QuoteCest $I->fillField(['name' => 'notes'], $this->faker->text(80)); $I->fillField(['name' => 'cost'], $this->faker->numberBetween(1, 20)); $I->click('Save'); - $I->wait(1); - //$I->see($productKey); + $I->see('Successfully created product'); // create quote $I->amOnPage('/quotes/create'); @@ -46,17 +74,17 @@ class QuoteCest $I->click('Mark Sent'); $I->see($clientEmail); - // enter payment - $clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]); - $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]); - $invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]); - - $clientSession = $I->haveFriend('client'); - $clientSession->does(function(AcceptanceTester $I) use ($invitationKey) { - $I->amOnPage('/view/' . $invitationKey); - $I->click('Approve'); - $I->see('Successfully approved'); - }); + $I->click('More Actions'); + $I->click('New Proposal'); + $I->see('Create'); + $I->selectDropdown($I, $templateName, '.template-select .dropdown-toggle'); + $I->click('Save'); + $I->click('Download'); + $I->click('More Actions'); + $I->click('View as recipient'); + $I->click('Download'); + $I->click('Approve'); + $I->see('Successfully approved'); } }