fix tests

This commit is contained in:
Daniel Friesel 2021-04-20 22:09:34 +02:00
parent aad2a53459
commit 582e8b874c
4 changed files with 17 additions and 0 deletions

View file

@ -43,6 +43,7 @@ my $csrf_token
$t->post_ok( $t->post_ok(
'/register' => form => { '/register' => form => {
csrf_token => $csrf_token, csrf_token => $csrf_token,
dt => 1,
user => 'someone', user => 'someone',
email => 'foo@example.org', email => 'foo@example.org',
password => 'foofoofoo', password => 'foofoofoo',
@ -51,10 +52,23 @@ $t->post_ok(
); );
$t->status_is(200)->content_like(qr{Verifizierungslink}); $t->status_is(200)->content_like(qr{Verifizierungslink});
# Failed registration (CSRF)
$t->post_ok(
'/register' => form => {
csrf_token => $csrf_token,
user => 'noone',
email => 'foo2@example.org',
password => 'foofoofoo',
password2 => 'foofoofoo',
}
);
$t->status_is(200)->content_like(qr{CSRF});
# Failed registration (user name not available) # Failed registration (user name not available)
$t->post_ok( $t->post_ok(
'/register' => form => { '/register' => form => {
csrf_token => $csrf_token, csrf_token => $csrf_token,
dt => 1,
user => 'someone', user => 'someone',
email => 'foo@example.org', email => 'foo@example.org',
password => 'foofoofoo', password => 'foofoofoo',

View file

@ -43,6 +43,7 @@ my $csrf_token
$t->post_ok( $t->post_ok(
'/register' => form => { '/register' => form => {
csrf_token => $csrf_token, csrf_token => $csrf_token,
dt => 1,
user => 'someone', user => 'someone',
email => 'foo@example.org', email => 'foo@example.org',
password => 'foofoofoo', password => 'foofoofoo',

View file

@ -45,6 +45,7 @@ my $csrf_token
$t->post_ok( $t->post_ok(
'/register' => form => { '/register' => form => {
csrf_token => $csrf_token, csrf_token => $csrf_token,
dt => 1,
user => 'someone', user => 'someone',
email => 'foo@example.org', email => 'foo@example.org',
password => 'foofoofoo', password => 'foofoofoo',

View file

@ -44,6 +44,7 @@ my $csrf_token
$t->post_ok( $t->post_ok(
'/register' => form => { '/register' => form => {
csrf_token => $csrf_token, csrf_token => $csrf_token,
dt => 1,
user => 'someone', user => 'someone',
email => 'foo@example.org', email => 'foo@example.org',
password => 'foofoofoo', password => 'foofoofoo',