From 6cdc8891c30c88471b9d3a7be7a4537a0c637146 Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 25 Aug 2017 15:47:54 +0100 Subject: [PATCH] Tests fixed --- t/admin/organisation.t | 4 ++++ t/api/register.t | 2 ++ t/api/search.t | 1 + t/api/stats.t | 1 + t/api/stats_leaderboards.t | 1 + t/api/upload.t | 1 + t/schema/leaderboard.t | 1 + t/schema/leaderboard_trend.t | 1 + t/schema/resultset_leaderboard.t | 1 + 9 files changed, 13 insertions(+) diff --git a/t/admin/organisation.t b/t/admin/organisation.t index 720415a..8ac7af6 100644 --- a/t/admin/organisation.t +++ b/t/admin/organisation.t @@ -21,6 +21,7 @@ $schema->resultset('Organisation')->create({ name => 'Shinra Electric Power Company', street_name => 'Sector 0, Midgar, Eastern Continent', town => 'Gaia', + sector => 'A', postcode => 'WC1E 6AD', }); @@ -53,6 +54,7 @@ $t->post_ok('/admin/organisations/valid/1/edit', form => { name => 'Shinra Electric Power Company', street_name => 'Sector 0, Midgar, Eastern Continent', town => 'Gaia', + sector => 'A', postcode => 'WC1E 6AD', })->status_is(200)->content_like(qr/Updated Organisation/); @@ -60,6 +62,7 @@ $t->post_ok('/admin/organisations/valid/1/edit', form => { $t->post_ok('/admin/organisations/valid/1/edit', form => { name => 'Shinra Electric Power Company', street_name => 'Sector 0, Midgar, Eastern Continent', + sector => 'A', postcode => 'WC1E 6AD', })->content_like(qr/The validation has failed/); @@ -83,6 +86,7 @@ $t->post_ok('/admin/organisations/add/submit', form => { name => 'Wall Market', street_name => 'Slums, Sector 6', town => 'Midgar', + sector => 'A', postcode => 'TN35 5AQ', })->status_is(200)->content_like(qr/Added Organisation/); diff --git a/t/api/register.t b/t/api/register.t index a1a20ec..203cde4 100644 --- a/t/api/register.t +++ b/t/api/register.t @@ -342,6 +342,7 @@ $testJson = { 'email' => 'org@org.com', 'postcode' => 'LA1 1AA', 'password' => 'Meh', + 'sector' => 'A', }; $t->post_ok('/api/register' => json => $testJson) ->status_is(400) @@ -360,6 +361,7 @@ $testJson = { 'password' => 'Meh', 'street_name' => 'mary lane testing....', 'town' => 'Lancaster', + 'sector' => 'A', }; $t->post_ok('/api/register' => json => $testJson) ->status_is(200) diff --git a/t/api/search.t b/t/api/search.t index ada3c0a..dbc688d 100644 --- a/t/api/search.t +++ b/t/api/search.t @@ -55,6 +55,7 @@ $testJson = { 'password' => $passwordBilly, 'street_name' => 'Market St', 'town' => 'Lancaster', + 'sector' => 'A', }; $t->post_ok('/api/register' => json => $testJson) ->status_is(200) diff --git a/t/api/stats.t b/t/api/stats.t index d12bcbe..2a6d889 100644 --- a/t/api/stats.t +++ b/t/api/stats.t @@ -28,6 +28,7 @@ my $org = { town => 'Lancaster', postcode => 'LA1 1AA', password => 'abc123', + sector => 'A', }; $schema->resultset('AccountToken')->create({ name => $user->{token} }); diff --git a/t/api/stats_leaderboards.t b/t/api/stats_leaderboards.t index 3b494ff..11003c2 100644 --- a/t/api/stats_leaderboards.t +++ b/t/api/stats_leaderboards.t @@ -56,6 +56,7 @@ my $org = { name => 'Test Org', street_name => 'Test Street', town => 'Lancaster', + sector => 'A', postcode => 'LA1 1AA', password => 'abc123', }; diff --git a/t/api/upload.t b/t/api/upload.t index 0cac28b..72020d3 100644 --- a/t/api/upload.t +++ b/t/api/upload.t @@ -81,6 +81,7 @@ $testJson = { 'password' => $passwordBilly, 'street_name' => 'Chocobo Farm, Eastern Continent', 'town' => 'Gaia', + 'sector' => 'A', }; $t->post_ok('/api/register' => json => $testJson) ->status_is(200) diff --git a/t/schema/leaderboard.t b/t/schema/leaderboard.t index 5d09595..5915760 100644 --- a/t/schema/leaderboard.t +++ b/t/schema/leaderboard.t @@ -58,6 +58,7 @@ my $org = { town => 'Lancaster', postcode => 'LA1 1AA', password => 'abc123', + sector => 'A', }; $schema->resultset('AccountToken')->create({ name => $_->{token} }) diff --git a/t/schema/leaderboard_trend.t b/t/schema/leaderboard_trend.t index 0674e68..33e7ea9 100644 --- a/t/schema/leaderboard_trend.t +++ b/t/schema/leaderboard_trend.t @@ -58,6 +58,7 @@ my $org = { town => 'Lancaster', postcode => 'LA1 1AA', password => 'abc123', + sector => 'A', }; $schema->resultset('AccountToken')->create({ name => $_->{token} }) diff --git a/t/schema/resultset_leaderboard.t b/t/schema/resultset_leaderboard.t index c1ab6b1..92b1120 100644 --- a/t/schema/resultset_leaderboard.t +++ b/t/schema/resultset_leaderboard.t @@ -58,6 +58,7 @@ my $org = { town => 'Lancaster', postcode => 'LA1 1AA', password => 'abc123', + sector => 'A', }; $schema->resultset('AccountToken')->create({ name => $_->{token} })