my $new_address = 'foobarhogehoge@example.com';
+ # send invalid address
+ $t->post_ok('/api/v1/user' => {Accept => '*/*'} => json => { type => "email",
+ address => "foobarhogehoge" })
+ ->status_is(400)
+ ->content_type_like(qr|application/json|)
+ ->json_is('/error', 1)
+ ->json_is('/message', "INVALID_ADDRESS");
+ diag dumper $t->tx->res->json if !$t->success;
+
+ # send
$t->post_ok('/api/v1/user' => {Accept => '*/*'} => json => { type => "email",
address => $new_address })
->status_is(200)