Commit e13e8ad5 authored by Dominique Merle's avatar Dominique Merle 💬
Browse files

Half-implement the latest specs.

The feature suite passes, but it's a lie.
parent 5091e7d9
......@@ -41,7 +41,7 @@ class ApiRestFeatureContext extends BaseFeatureContext
/**
* This step makes multiple requests, one per given mention.
*
* @When /^(?P<actor>.+?)(?P<try> *essa[iy]ez? de)? vot(?:e[szr]?|ent) sur le scrutin au jugement majoritaire titré "(?P<title>.+)" *:$/ui
* @When /^(?P<actor>.+?)(?P<try> (?:essa[iy]ez?|tente) de|) vot(?:e[szr]?|ent) sur le scrutin au jugement majoritaire titré "(?P<title>.+)" *:$/ui
* @When /^(?P<actor>.+?)(?P<try> tr(?:y|ies) to)? votes? on the majority judgment poll titled "(?P<title>.+)" *:$/ui
*/
public function actorVotesOnTheLimajuPollTitled($actor, $try, $title, $pystring)
......@@ -66,7 +66,7 @@ class ApiRestFeatureContext extends BaseFeatureContext
/**
* @When /^(?P<actor>.+?)(?P<try> *essa[iy]ez? de|) cré(?:e[szr]?|ent) (?:le|un) scrutin au jugement majoritaire (?:comme suit|suivant) *:$/u
* @When /^(?P<actor>.+?)(?P<try> (?:essa[iy]ez?|tente) de|) cré(?:e[szr]?|ent) (?:le|un) scrutin au jugement majoritaire (?:comme suit|suivant) *:$/u
* @When /^(?P<actor>.+?)(?P<try> tr(?:y|ies) to|) creates? the following majority judgment poll:$/ui
*/
public function actorSubmitsTheLimajuPollLikeSo($actor, $try, $pystring)
......@@ -92,4 +92,27 @@ class ApiRestFeatureContext extends BaseFeatureContext
);
}
public $that_tally;
/**
* @When /^(?P<actor>.+?)(?P<try> (?:essa[iy]ez?|tente) de|) dépouill(?:e[szr]?|ent) le scrutin titré "(?P<title>.+)"$/ui
* When /^(?P<actor>.+?)(?P<try> tr(?:y|ies) to)? tall(?:y|ies) the majority judgment poll titled "(?P<title>.+)"$/ui
*/
public function actorTalliesTheLimajuPollTitled($actor, $try, $title)
{
$poll = $this->findOneLimajuPollFromTitle($title);
$tx = $this->actor($actor)->api(
'GET',"/limaju_poll_tally/".$poll->getId(),
[], [], !empty($try)
);
if ($tx->getResponse()->isSuccessful()) {
$this->that_tally = json_decode($tx->getResponse()->getContent());
} else {
$this->that_tally = null;
}
}
}
......@@ -34,7 +34,7 @@ class MainFeatureContext extends BaseFeatureContext
/**
* @Given /^a citizen named (?P<name>.+)$/ui
* @Given /^un(?:⋅?e)? citoyen(?:⋅?ne)?(?: .*)? (?:sur)?nommé(?:⋅?e)? (?P<name>.+)$/ui
* @Given /^un(?:⋅?e)? (?:utilisat(?:eure?|rice)|citoyen(?:⋅?ne)?)(?: .*)? (?:sur)?nommé(?:⋅?e)? (?P<name>.+)$/ui
*/
public function givenCitizenNamed($name)
{
......
Subproject commit 3222907a6e9b9f147a86c5d6d7708f880ba7264f
Subproject commit a14bb8424a3a7d822dfd4d9acbd456ffa81852e1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment