customer stats test fixed

This commit is contained in:
Finn 2018-03-21 16:01:46 +00:00
parent be0571f90b
commit a02c74d830
2 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ SELECT "value",
"seller_id", "seller_id",
DATETIME(STRFTIME('%Y-%m-%d %H:00:00',"purchase_time")) AS "quantised_hours", DATETIME(STRFTIME('%Y-%m-%d %H:00:00',"purchase_time")) AS "quantised_hours",
DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time")) AS "quantised_days", DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time")) AS "quantised_days",
DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time", 'weekday 1')) AS "quantised_weeks" DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time",'weekday 0','-6 days')) AS "quantised_weeks"
FROM "transactions" FROM "transactions"
/); /);

View file

@ -49,11 +49,11 @@ $t->post_ok('/api/stats/customer' => json => {
}) })
->status_is(200)->or($framework->dump_error) ->status_is(200)->or($framework->dump_error)
->json_is('/weeks', { ->json_is('/weeks', {
first => 2, first => 20,
second => 21, second => 20,
max => 22, max => 22,
sum => 118, sum => 118,
count => 7, count => 6,
}) })
->or($framework->dump_error) ->or($framework->dump_error)
->json_is('/sectors', { ->json_is('/sectors', {