From a89a32068591cfdf299e1b9436094c841ec10c48 Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 15 Dec 2017 17:52:02 +0000 Subject: [PATCH] tests fixed --- t/api/stats.t | 6 ++++++ t/etc/fixtures/config/users.pl | 2 +- t/etc/fixtures/data/users/organisations/1.fix | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/t/api/stats.t b/t/api/stats.t index 9ef6397..cad04ff 100644 --- a/t/api/stats.t +++ b/t/api/stats.t @@ -38,12 +38,18 @@ my $session_key = $framework->login({ password => 'abc123', }); +#TODO be able to define start and end below in request + $t->post_ok('/api/stats' => json => { session_key => $session_key, }) ->status_is(200)->or($framework->dump_error) ->json_is('/weeks', { purchases => [ 8, 21, 19, 22, 20, 20, 8 ], + }) + ->json_is('/sectors', { + sectors => ['A'], + purchases => [118], }); sub create_random_transaction { diff --git a/t/etc/fixtures/config/users.pl b/t/etc/fixtures/config/users.pl index 9a7f5ca..0341077 100644 --- a/t/etc/fixtures/config/users.pl +++ b/t/etc/fixtures/config/users.pl @@ -91,6 +91,7 @@ my $entity5 = { street_name => 'Test Street', town => 'Lancaster', postcode => 'LA1 1AA', + sector => 'A', }, user => { email => 'org@example.com', @@ -124,4 +125,3 @@ $fixtures->dump({ schema => $schema, directory => "$Bin/../data/" . $data_set, }); - diff --git a/t/etc/fixtures/data/users/organisations/1.fix b/t/etc/fixtures/data/users/organisations/1.fix index b761450..72165ed 100644 --- a/t/etc/fixtures/data/users/organisations/1.fix +++ b/t/etc/fixtures/data/users/organisations/1.fix @@ -7,7 +7,7 @@ $HASH1 = { pending => 0, postcode => 'LA1 1AA', - sector => undef, + sector => 'A', street_name => 'Test Street', submitted_by_id