Commit 91012074 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Add test for account (un)deletion

parent 2b54ecf7
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -90,5 +90,31 @@ $t->post_ok(
);
$t->status_is(302)->header_is( location => '/' );

# Request deletion

$csrf_token = $t->ua->get('/account')->res->dom->at('input[name=csrf_token]')
  ->attr('value');

$t->post_ok(
	'/delete' => form => {
		action     => 'delete',
		csrf_token => $csrf_token,
		password   => 'foofoofoo',
	}
);
$t->status_is(302)->header_is( location => '/account' );
$t->get_ok('/account');
$t->status_is(200)->content_like(qr{wird gelöscht});

$t->post_ok(
	'/delete' => form => {
		action     => 'undelete',
		csrf_token => $csrf_token,
	}
);
$t->status_is(302)->header_is( location => '/account' );
$t->get_ok('/account');
$t->status_is(200)->content_unlike(qr{wird gelöscht});

$t->app->pg->db->query('drop schema travelynx_test_02 cascade');
done_testing();