Skip to content

Commit

Permalink
feat (afup#1110): functional test
Browse files Browse the repository at this point in the history
Site public :
- Adhésion personne morale
  • Loading branch information
stakovicz committed Nov 16, 2023
1 parent 358cabf commit 99623cb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ services:
AppBundle\Offices\OfficeFinder:
class: AppBundle\Offices\NullOfficeFinder
arguments: [ '@Geocoder\Provider\GoogleMaps' ]

ewz_recaptcha:
enabled: false
7 changes: 6 additions & 1 deletion sources/AppBundle/Controller/MemberShipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public function becomeMemberAction()

public function companyAction(Request $request)
{
$subscribeForm = $this->createForm(CompanyMemberType::class);
$data = new CompanyMember();
$data->setInvitations([
(new CompanyMemberInvitation())->setManager(true)
]);

$subscribeForm = $this->createForm(CompanyMemberType::class, $data);
$subscribeForm->handleRequest($request);

if ($subscribeForm->isSubmitted() && $subscribeForm->isValid()) {
Expand Down
21 changes: 18 additions & 3 deletions tests/behat/features/PublicSite/Register.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,27 @@ Feature: Site Public - Register
And I fill in "company_member_address" with "45 rue des Roses"
And I fill in "company_member_zipcode" with "69003"
And I fill in "company_member_city" with "LYON"
And I fill in "company_member_firstName" with "Mon prénom"
And I fill in "company_member_lastName" with "Mon nom"
And I fill in "company_member_firstName" with "Mon prénom de dirigeant"
And I fill in "company_member_lastName" with "Mon nom de dirigeant"
And I fill in "company_member_email" with "[email protected]"
And I fill in "company_member_phone" with "0123456"
And print last response
And I fill in "company_member[invitations][0][email]" with "[email protected]"
And I press "Enregistrer mon adhésion"
And I should see "Adhésion enregistrée !"
And I should see "Montant de la cotisation: 150.00 Euros"
When I press "Régler par carte"
# Pour suivre la redirection POST de Paybox
And I submit the form with name "PAYBOX"
When I fill in "NUMERO_CARTE" with "1111222233334444"
And I select "12" from "MOIS_VALIDITE"
And I select "25" from "AN_VALIDITE"
And I fill in "CVVX" with "123"
And I press "Valider"
Then I should see "PAIEMENT ACCEPTÉ"
When I follow "Retour"
Then I should see "Le paiement de votre cotisation s'est bien passé, merci."
# Simuler l'appel de callback Paybox
And simulate the Paybox callback
And I should only receive the following emails:
| to | subject |
| <registeredUser@gmail.com> | Une société vous invite à profiter de son compte "Membre AFUP" |

0 comments on commit 99623cb

Please sign in to comment.