Skip to content
Snippets Groups Projects
Verified Commit 5a087391 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Test websocketu

parent 93e84f8f
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ use Test::More; ...@@ -4,7 +4,7 @@ use Test::More;
use Test::Mojo; use Test::Mojo;
my $t = Test::Mojo->new('CF'); my $t = Test::Mojo->new('CF');
$t->get_ok('/api.html')->status_is(200)->content_like(qr/CF Online/i);
$t->get_ok('/api.json')->status_is(200) $t->get_ok('/api.json')->status_is(200)
->json_is('/openapi' => '3.0.3') ->json_is('/openapi' => '3.0.3')
->json_is('/info/title' => 'CF Online') ->json_is('/info/title' => 'CF Online')
......
t/ws.t 0 → 100644
use Mojo::Base -strict;
use Test::More;
use Test::Mojo;
my $t = Test::Mojo->new('CF');
# Test JSON web service
$t->websocket_ok('/ws')
->send_ok({json => {event => 'KEEPALIVE'}})
->message_ok
->json_message_is('/event' => 'online_users_updated')
->json_message_has('/payload/all')
->finish_ok;
;
done_testing();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment