basic test: No DB needed; perltidy

This commit is contained in:
Daniel Friesel 2019-04-18 14:52:51 -04:00
parent eff979081c
commit 4aa83625d3

View file

@ -8,27 +8,27 @@ use Test::Mojo;
use FindBin; use FindBin;
require "$FindBin::Bin/../index.pl"; require "$FindBin::Bin/../index.pl";
my $t = Test::Mojo->new(Travelynx => {db => {user => 'travelynx_temp'}}); my $t = Test::Mojo->new('Travelynx');
$t->get_ok('/')->status_is(200); $t->get_ok('/')->status_is(200);
$t->text_like('a[href="/register"]' => qr{Registrieren}); $t->text_like( 'a[href="/register"]' => qr{Registrieren} );
$t->text_like('a[href="/login"]' => qr{Anmelden}); $t->text_like( 'a[href="/login"]' => qr{Anmelden} );
$t->get_ok('/register')->status_is(200); $t->get_ok('/register')->status_is(200);
$t->element_exists('input[name="csrf_token"]'); $t->element_exists('input[name="csrf_token"]');
$t->element_exists('a[href="/impressum"]'); $t->element_exists('a[href="/impressum"]');
$t->text_like('button' => qr{Registrieren}); $t->text_like( 'button' => qr{Registrieren} );
$t->get_ok('/login')->status_is(200); $t->get_ok('/login')->status_is(200);
$t->element_exists('input[name="csrf_token"]'); $t->element_exists('input[name="csrf_token"]');
$t->text_like('button' => qr{Anmelden}); $t->text_like( 'button' => qr{Anmelden} );
$t->get_ok('/about')->status_is(200); $t->get_ok('/about')->status_is(200);
# Protected sites should redirect to login form # Protected sites should redirect to login form
for my $protected (qw(/account /change_password /history /s/EE)) { for my $protected (qw(/account /change_password /history /s/EE)) {
$t->get_ok($protected)->text_like('button' => qr{Anmelden}); $t->get_ok($protected)->text_like( 'button' => qr{Anmelden} );
} }
# Otherwise, we expect a 404 # Otherwise, we expect a 404