From 5713f03cf2756d39d3cf51c86b673e5b4ff3f4e4 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 20 Jul 2017 16:41:35 +0100 Subject: [PATCH] Fix test Needed to initialise a leaderboard for monthly stats --- t/api/stats.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/api/stats.t b/t/api/stats.t index 7468795..57ce15a 100644 --- a/t/api/stats.t +++ b/t/api/stats.t @@ -44,6 +44,8 @@ my $session_key = $framework->login({ password => $user->{password}, }); +$t->app->schema->resultset('Leaderboard')->create_new( 'monthly_total', DateTime->now->truncate(to => 'month' )->subtract( months => 1) ); + $t->post_ok('/api/stats' => json => { session_key => $session_key } ) ->status_is(200) ->json_is('/success', Mojo::JSON->true)