From e284b14fff0c7000a242ea58b7f9a7c20b02103c Mon Sep 17 00:00:00 2001
From: Paul Dill
Date: Fri, 10 Mar 2017 17:36:41 +0000
Subject: [PATCH] Make upload test use the JSON response value for the
unvalidated organisation id.
---
t/upload.t | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/t/upload.t b/t/upload.t
index c3670dd..cedc1de 100644
--- a/t/upload.t
+++ b/t/upload.t
@@ -275,9 +275,6 @@ is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations")}[0],1,"1 pending organisation";
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions")}[0],1,"1 pending transaction";
-
-my ($organisationId) = $t->app->db->selectrow_array("SELECT PendingOrganisationId FROM PendingOrganisations LIMIT 1",undef,());
-
# Add type 2 (unverified organisation) checking.
print "test 18 - addUnvalidatedId missing (type 2: existing organisation)\n";
@@ -341,7 +338,7 @@ is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions")
$json = {
microCurrencyValue => 10,
transactionAdditionType => 2,
- addUnvalidatedId => $organisationId,
+ addUnvalidatedId => $unvalidatedOrganisationId,
};
my $upload = {json => Mojo::JSON::encode_json($json), file2 => {file => './t/test.jpg'}};
$t->post_ok('/upload' => form => $upload )
@@ -376,7 +373,7 @@ is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions")
$json = {
microCurrencyValue => 10,
transactionAdditionType => 2,
- addUnvalidatedId => $organisationId,
+ addUnvalidatedId => $unvalidatedOrganisationId,
};
my $upload = {json => Mojo::JSON::encode_json($json), file2 => {file => './t/test.jpg'}};
$t->post_ok('/upload' => form => $upload )