Started with basic today stats

This commit is contained in:
Tom Bloor 2017-05-16 21:30:38 +01:00
parent 22abc4e464
commit 86955c0d1c
5 changed files with 150 additions and 0 deletions

View file

@ -65,6 +65,16 @@ sub register_customer {
->json_is('/success', Mojo::JSON->true)->or($self->dump_error);
}
sub register_organisation {
my ( $self, $args ) = @_;
$args->{usertype} = 'organisation';
$self->framework->post_ok('/api/register' => json => $args)
->status_is(200)->or($self->dump_error)
->json_is('/success', Mojo::JSON->true)->or($self->dump_error);
}
sub login {
my $self = shift;
my $args = shift;
@ -76,4 +86,19 @@ sub login {
return $self->framework->tx->res->json->{session_key};
}
sub gen_upload {
my ( $self, $args ) = @_;
my $file = {
content => '',
filename => 'text.jpg',
'Content-Type' => 'image/jpeg',
};
return {
json => Mojo::JSON::encode_json($args),
file => $file,
};
}
1;