Commit fc955e29 authored by Julien Fastré's avatar Julien Fastré
Browse files

Replace search link on main page to point to chill_main_search and fix tests

parent 51d6bed4
......@@ -35,7 +35,7 @@
<input type="password" name="_password" />
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
<br/>
<button type="submit">{{ 'Login'|trans }}</button>
<button type="submit" name="login">{{ 'Login'|trans }}</button>
</form>
......
......@@ -100,7 +100,7 @@
<div class="grid-8 centered">
<h2>{{ 'Search a person'|trans }}</h2>
<form action="{{ path('chill_person_search') }}" method="get">
<form action="{{ path('chill_main_search') }}" method="get">
<input name="q" type="search" placeholder="{{ 'Person name'|trans }}" />
<center>
<button type="submit" class="sc-button orange"><i class="fa fa-search"></i> {{ 'Search a person'|trans }}</button>
......
......@@ -9,13 +9,21 @@ class LoginControllerTest extends WebTestCase
{
public function testLogin()
{
$client = static::createClient();
$client = static::createClient(array(
'framework' => array(
'default_locale' => 'en',
'translator' => array(
'fallback' => 'en'
)
),
));
//load login page and submit form
$crawler = $client->request('GET', '/login');
$this->assertTrue($client->getResponse()->isSuccessful());
$buttonCrawlerNode = $crawler->selectButton('Login');
$buttonCrawlerNode = $crawler->selectButton('login');
$form = $buttonCrawlerNode->form();
$client->submit($form, array(
......@@ -40,7 +48,7 @@ class LoginControllerTest extends WebTestCase
$logoutLinkFilter = $crawler->filter('a:contains("Logout")');
//check there is > 0 logout link
$this->assertGreaterThan(0, $logoutLinkFilter->count());
$this->assertGreaterThan(0, $logoutLinkFilter->count(), 'check that a logout link is present');
//click on logout link
$client->followRedirects(false);
......
......@@ -7,8 +7,8 @@ framework:
form: true
csrf_protection: true
session: ~
default_locale: fr
translator: { fallback: fr }
default_locale: en
translator: { fallback: en }
profiler: { only_exceptions: false }
templating:
engines: ['twig']
......
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