Fixed admin-merge test after refactoring
This commit is contained in:
parent
9bc38c85ea
commit
b48edea9fb
2 changed files with 159 additions and 238 deletions
|
@ -3,6 +3,11 @@ use Mojo::Base 'Mojolicious::Controller';
|
||||||
|
|
||||||
has error_messages => sub {
|
has error_messages => sub {
|
||||||
return {
|
return {
|
||||||
|
target_organisation_id => {
|
||||||
|
required => { message => 'target_organisation_id is missing', status => 400 },
|
||||||
|
number => { message => 'target_organisation_id is not a number', status => 400 },
|
||||||
|
in_resultset => { message => 'target_organisation_id does not exist in the database', status => 400 },
|
||||||
|
},
|
||||||
pending_organisation_id => {
|
pending_organisation_id => {
|
||||||
required => { message => 'pending_organisation_id is missing', status => 400 },
|
required => { message => 'pending_organisation_id is missing', status => 400 },
|
||||||
number => { message => 'pending_organisation_id is not a number', status => 400 },
|
number => { message => 'pending_organisation_id is not a number', status => 400 },
|
||||||
|
@ -33,7 +38,6 @@ sub auth {
|
||||||
|
|
||||||
sub post_admin_approve {
|
sub post_admin_approve {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
my $self = $c;
|
|
||||||
|
|
||||||
my $validation = $c->validation;
|
my $validation = $c->validation;
|
||||||
|
|
||||||
|
@ -57,22 +61,9 @@ sub post_admin_approve {
|
||||||
postcode => $validation->param('postcode') || $pending_org->postcode,
|
postcode => $validation->param('postcode') || $pending_org->postcode,
|
||||||
});
|
});
|
||||||
|
|
||||||
my $pending_transaction_rs = $pending_org->pending_transactions;
|
$c->copy_transactions_and_delete( $pending_org, $valid_org );
|
||||||
|
|
||||||
while ( my $pending_transaction = $pending_transaction_rs->next ) {
|
return $c->render(
|
||||||
$valid_org->create_related(
|
|
||||||
'transactions', {
|
|
||||||
buyeruserid_fk => $pending_transaction->buyeruserid_fk,
|
|
||||||
valuemicrocurrency => $pending_transaction->valuemicrocurrency,
|
|
||||||
proofimage => $pending_transaction->proofimage,
|
|
||||||
timedatesubmitted => $pending_transaction->timedatesubmitted,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$pending_org->delete;
|
|
||||||
|
|
||||||
return $self->render(
|
|
||||||
json => {
|
json => {
|
||||||
success => Mojo::JSON->true,
|
success => Mojo::JSON->true,
|
||||||
message => 'Successfully Approved Organisation',
|
message => 'Successfully Approved Organisation',
|
||||||
|
@ -83,111 +74,53 @@ sub post_admin_approve {
|
||||||
|
|
||||||
|
|
||||||
sub post_admin_merge {
|
sub post_admin_merge {
|
||||||
my $self = shift;
|
my $c = shift;
|
||||||
|
|
||||||
my $userId = $self->get_active_user_id();
|
my $validation = $c->validation;
|
||||||
if ( ! $self->is_admin($userId) ) {
|
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'You are not an admin.',
|
|
||||||
},
|
|
||||||
status => 403,); #Forbidden request
|
|
||||||
}
|
|
||||||
|
|
||||||
my $json = $self->req->json;
|
$validation->input( $c->stash->{api_json} );
|
||||||
if ( ! defined $json ) {
|
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'JSON is missing.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
|
|
||||||
my $unvalidatedOrganisationId = $json->{unvalidatedOrganisationId};
|
my $pending_org_rs = $c->schema->resultset('PendingOrganisation');
|
||||||
if ( ! defined $unvalidatedOrganisationId ) {
|
$validation->required('pending_organisation_id')->number->in_resultset('id', $pending_org_rs);
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'unvalidatedOrganisationId is missing.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
elsif (! Scalar::Util::looks_like_number($unvalidatedOrganisationId)){
|
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'unvalidatedOrganisationId does not look like a number.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
|
|
||||||
my $validatedOrganisationId = $json->{validatedOrganisationId};
|
my $valid_org_rs = $c->schema->resultset('Organisation');
|
||||||
if ( ! defined $validatedOrganisationId ) {
|
$validation->required('target_organisation_id')->number->in_resultset('id', $valid_org_rs);
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'validatedOrganisationId is missing.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
elsif (! Scalar::Util::looks_like_number($validatedOrganisationId)){
|
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'validatedOrganisationId does not look like a number.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $c->api_validation_error if $validation->has_error;
|
||||||
|
|
||||||
|
my $pending_org = $pending_org_rs->find( $validation->param('pending_organisation_id') );
|
||||||
|
my $target_org = $valid_org_rs->find( $validation->param('target_organisation_id') );
|
||||||
|
|
||||||
|
$c->copy_transactions_and_delete( $pending_org, $target_org );
|
||||||
#FIXME This requires mutual exclusion.
|
#FIXME This requires mutual exclusion.
|
||||||
|
|
||||||
my $doesUnvalidatedIdNotExist = ($self->db->selectrow_array("SELECT COUNT(*) FROM PendingOrganisations WHERE PendingOrganisationId = ?", undef, ($unvalidatedOrganisationId)) == 0);
|
return $c->render(
|
||||||
if ($doesUnvalidatedIdNotExist) {
|
json => {
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'unvalidatedOrganisationId does not exist in the database.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
|
|
||||||
my $doesValidatedIdNotExist = ($self->db->selectrow_array("SELECT COUNT(*) FROM Organisations WHERE OrganisationalId = ?", undef, ($validatedOrganisationId)) == 0);
|
|
||||||
if ($doesValidatedIdNotExist) {
|
|
||||||
$self->app->log->debug('Path Error: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->false,
|
|
||||||
message => 'validatedOrganisationId does not exist in the database.',
|
|
||||||
},
|
|
||||||
status => 400,); #Malformed request
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#FIXME there may be race conditions here, so may get the wrong number, mutux is needed.
|
|
||||||
my $statementSelectPendingTrans = $self->db->prepare("SELECT BuyerUserId_FK, ValueMicroCurrency, ProofImage, TimeDateSubmitted FROM PendingTransactions WHERE PendingSellerOrganisationId_FK = ?");
|
|
||||||
$statementSelectPendingTrans->execute($unvalidatedOrganisationId);
|
|
||||||
|
|
||||||
my $statementInsTrans = $self->db->prepare("INSERT INTO Transactions (BuyerUserId_FK, SellerOrganisationId_FK, ValueMicroCurrency, ProofImage, TimeDateSubmitted) VALUES (?, ?, ?, ?, ?)");
|
|
||||||
|
|
||||||
#Move all transactions from pending onto verified.
|
|
||||||
while (my ($buyerUserId, $value, $imgName, $timeDate) = $statementSelectPendingTrans->fetchrow_array()) {
|
|
||||||
$statementInsTrans->execute($buyerUserId, $validatedOrganisationId, $value, $imgName, $timeDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
#Delete transactions first, so there is no dependancy when deleting the row from PendingOrganisations.
|
|
||||||
$self->db->prepare("DELETE FROM PendingTransactions WHERE PendingSellerOrganisationId_FK = ?")->execute($unvalidatedOrganisationId);
|
|
||||||
$self->db->prepare("DELETE FROM PendingOrganisations WHERE PendingOrganisationId = ?")->execute($unvalidatedOrganisationId);
|
|
||||||
|
|
||||||
$self->app->log->debug('Path Success: file:' . __FILE__ . ', line: ' . __LINE__);
|
|
||||||
return $self->render( json => {
|
|
||||||
success => Mojo::JSON->true,
|
success => Mojo::JSON->true,
|
||||||
|
message => 'Successfully Merged Organisations',
|
||||||
},
|
},
|
||||||
status => 200,);
|
status => 200,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub copy_transactions_and_delete {
|
||||||
|
my ( $c, $from_org, $to_org ) = @_;
|
||||||
|
|
||||||
|
my $from_org_transaction_rs = $from_org->pending_transactions;
|
||||||
|
|
||||||
|
while ( my $from_org_transaction = $from_org_transaction_rs->next ) {
|
||||||
|
$to_org->create_related(
|
||||||
|
'transactions', {
|
||||||
|
buyeruserid_fk => $from_org_transaction->buyeruserid_fk,
|
||||||
|
valuemicrocurrency => $from_org_transaction->valuemicrocurrency,
|
||||||
|
proofimage => $from_org_transaction->proofimage,
|
||||||
|
timedatesubmitted => $from_org_transaction->timedatesubmitted,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$from_org->delete;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
244
t/admin-merge.t
244
t/admin-merge.t
|
@ -1,36 +1,20 @@
|
||||||
use Mojo::Base -strict;
|
use Mojo::Base -strict;
|
||||||
|
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use Test::Mojo;
|
|
||||||
use Mojo::JSON;
|
use Mojo::JSON;
|
||||||
|
use Test::Pear::LocalLoop;
|
||||||
|
|
||||||
use FindBin;
|
my $framework = Test::Pear::LocalLoop->new;
|
||||||
|
my $t = $framework->framework;
|
||||||
|
my $schema = $t->app->schema;
|
||||||
|
my $dump_error = sub { diag $t->tx->res->dom->at('pre[id="error"]')->text };
|
||||||
|
|
||||||
BEGIN {
|
my @account_tokens = ('a', 'b', 'c');
|
||||||
$ENV{MOJO_MODE} = 'testing';
|
|
||||||
$ENV{MOJO_LOG_LEVEL} = 'debug';
|
|
||||||
}
|
|
||||||
|
|
||||||
my $t = Test::Mojo->new("Pear::LocalLoop");
|
|
||||||
|
|
||||||
my $dbh = $t->app->db;
|
|
||||||
|
|
||||||
#Dump all pf the test tables and start again.
|
|
||||||
my $sqlDeployment = Mojo::File->new("$FindBin::Bin/../dropschema.sql")->slurp;
|
|
||||||
for (split ';', $sqlDeployment){
|
|
||||||
$dbh->do($_) or die $dbh->errstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sqlDeployment = Mojo::File->new("$FindBin::Bin/../schema.sql")->slurp;
|
|
||||||
for (split ';', $sqlDeployment){
|
|
||||||
$dbh->do($_) or die $dbh->errstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
my @accountTokens = ('a', 'b', 'c');
|
|
||||||
my $tokenStatement = $dbh->prepare('INSERT INTO AccountTokens (AccountTokenName) VALUES (?)');
|
|
||||||
foreach (@accountTokens){
|
|
||||||
my $rowsAdded = $tokenStatement->execute($_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$schema->resultset('AccountToken')->populate([
|
||||||
|
[ 'accounttokenname' ],
|
||||||
|
map { [ $_ ] } @account_tokens,
|
||||||
|
]);
|
||||||
|
|
||||||
#This depends on "register.t", "login.t", "upload.t" and "admin-approve.t" working.
|
#This depends on "register.t", "login.t", "upload.t" and "admin-approve.t" working.
|
||||||
|
|
||||||
|
@ -40,7 +24,7 @@ my $emailReno = 'reno@shinra.energy';
|
||||||
my $passwordReno = 'turks';
|
my $passwordReno = 'turks';
|
||||||
my $testJson = {
|
my $testJson = {
|
||||||
'usertype' => 'customer',
|
'usertype' => 'customer',
|
||||||
'token' => shift(@accountTokens),
|
'token' => shift(@account_tokens),
|
||||||
'username' => 'Reno',
|
'username' => 'Reno',
|
||||||
'email' => $emailReno,
|
'email' => $emailReno,
|
||||||
'postcode' => 'E1 MP01',
|
'postcode' => 'E1 MP01',
|
||||||
|
@ -56,12 +40,13 @@ my $emailBilly = 'choco.billy@chocofarm.org';
|
||||||
my $passwordBilly = 'Choco';
|
my $passwordBilly = 'Choco';
|
||||||
$testJson = {
|
$testJson = {
|
||||||
'usertype' => 'organisation',
|
'usertype' => 'organisation',
|
||||||
'token' => shift(@accountTokens),
|
'token' => shift(@account_tokens),
|
||||||
'username' => 'ChocoBillysGreens',
|
'username' => 'ChocoBillysGreens',
|
||||||
'email' => $emailBilly,
|
'email' => $emailBilly,
|
||||||
'postcode' => 'E4 C12',
|
'postcode' => 'E4 C12',
|
||||||
'password' => $passwordBilly,
|
'password' => $passwordBilly,
|
||||||
'fulladdress' => 'Chocobo Farm, Eastern Continent, Gaia'
|
'street_name' => 'Chocobo Farm, Eastern Continent',
|
||||||
|
town => 'Gaia',
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/register' => json => $testJson)
|
$t->post_ok('/api/register' => json => $testJson)
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
|
@ -73,7 +58,7 @@ my $emailAdmin = 'admin@foodloop.net';
|
||||||
my $passwordAdmin = 'ethics';
|
my $passwordAdmin = 'ethics';
|
||||||
$testJson = {
|
$testJson = {
|
||||||
'usertype' => 'customer',
|
'usertype' => 'customer',
|
||||||
'token' => shift(@accountTokens),
|
'token' => shift(@account_tokens),
|
||||||
'username' => 'admin',
|
'username' => 'admin',
|
||||||
'email' => $emailAdmin,
|
'email' => $emailAdmin,
|
||||||
'postcode' => 'NW1 W01',
|
'postcode' => 'NW1 W01',
|
||||||
|
@ -85,11 +70,10 @@ $t->post_ok('/api/register' => json => $testJson)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
|
|
||||||
print "test 4 - Making 'admin' an Admin\n";
|
print "test 4 - Making 'admin' an Admin\n";
|
||||||
my $adminUserId = $t->app->db->selectrow_array("SELECT UserId FROM Users WHERE Email = ?", undef, ($emailAdmin));
|
my $rufus_user = $schema->resultset('User')->find({ email => $emailAdmin });
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Administrators")}[0],0,"No admins";
|
is $schema->resultset('Administrator')->count, 0, "No admins";
|
||||||
$t->app->db->prepare("INSERT INTO Administrators (UserId) VALUES (?)")->execute($adminUserId);
|
$rufus_user->find_or_create_related('administrator', {});
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Administrators")}[0],1,"1 admin";
|
is $schema->resultset('Administrator')->count, 1, "1 admin";
|
||||||
|
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
|
@ -106,10 +90,11 @@ $t->post_ok('/api/login' => json => $testJson)
|
||||||
my $session_key = $t->tx->res->json('/session_key');
|
my $session_key = $t->tx->res->json('/session_key');
|
||||||
|
|
||||||
print "test 6 - add valid transaction (type 3: new organisation)\n";
|
print "test 6 - add valid transaction (type 3: new organisation)\n";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],0,"No unverified organisations.";
|
is $schema->resultset('PendingOrganisation')->count, 0, "No unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],0,"No unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 0, "No unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisation (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
my $nameToTestTurtle = 'Turtle\'s Paradise';
|
my $nameToTestTurtle = 'Turtle\'s Paradise';
|
||||||
my $json = {
|
my $json = {
|
||||||
transaction_value => 20,
|
transaction_value => 20,
|
||||||
|
@ -124,12 +109,12 @@ my $upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test
|
||||||
$t->post_ok('/api/upload' => form => $upload )
|
$t->post_ok('/api/upload' => form => $upload )
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],1,"1 unverified organisation." ;
|
is $schema->resultset('PendingOrganisation')->count, 1, "1 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],1,"1 unverified transaction." ;
|
is $schema->resultset('PendingTransaction')->count, 1, "1 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
my $newPendingTurtleOrgId = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestTurtle })->pendingorganisationid;
|
my $newPendingTurtleOrgId = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestTurtle })->id;
|
||||||
print "Turtle Id: " . $newPendingTurtleOrgId . "\n";
|
print "Turtle Id: " . $newPendingTurtleOrgId . "\n";
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,10 +140,10 @@ $t->post_ok('/api/login' => json => $testJson)
|
||||||
$session_key = $t->tx->res->json('/session_key');
|
$session_key = $t->tx->res->json('/session_key');
|
||||||
|
|
||||||
print "test 9 - add valid transaction (type 3: new organisation)\n";
|
print "test 9 - add valid transaction (type 3: new organisation)\n";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],1,"1 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 1, "1 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],1,"1 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 1, "1 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
my $nameToTestTurtlePartial = 'Turtle\'s Paradise2';
|
my $nameToTestTurtlePartial = 'Turtle\'s Paradise2';
|
||||||
$json = {
|
$json = {
|
||||||
|
@ -166,20 +151,20 @@ $json = {
|
||||||
transaction_type => 3,
|
transaction_type => 3,
|
||||||
organisation_name => $nameToTestTurtlePartial,
|
organisation_name => $nameToTestTurtlePartial,
|
||||||
street_name => "",
|
street_name => "",
|
||||||
town => "",
|
town => "Turtlesville",
|
||||||
postcode => "",
|
postcode => "",
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jpg'}};
|
$upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jpg'}};
|
||||||
$t->post_ok('/api/upload' => form => $upload )
|
$t->post_ok('/api/upload' => form => $upload )
|
||||||
->status_is(200)
|
->status_is(200)->or($dump_error)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],2,"2 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 2, "2 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],2,"2 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 2, "2 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
my $newPendingTurtleOrgIdPartial = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestTurtlePartial })->pendingorganisationid;
|
my $newPendingTurtleOrgIdPartial = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestTurtlePartial })->id;
|
||||||
print "Turtle Id 2: " . $newPendingTurtleOrgIdPartial . "\n";
|
print "Turtle Id 2: " . $newPendingTurtleOrgIdPartial . "\n";
|
||||||
|
|
||||||
#done_testing();
|
#done_testing();
|
||||||
|
@ -197,11 +182,10 @@ $upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jp
|
||||||
$t->post_ok('/api/upload' => form => $upload )
|
$t->post_ok('/api/upload' => form => $upload )
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],2,"2 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 2, "2 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],3,"3 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 3, "3 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
|
|
||||||
print "test 11 - add valid transaction (type 3: new organisation)\n";
|
print "test 11 - add valid transaction (type 3: new organisation)\n";
|
||||||
my $nameToTestJunon = 'Store';
|
my $nameToTestJunon = 'Store';
|
||||||
|
@ -219,14 +203,13 @@ $t->post_ok('/api/upload' => form => $upload)
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
|
|
||||||
my $newPendingJunonOrgId = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestJunon })->pendingorganisationid;
|
my $newPendingJunonOrgId = $t->app->schema->resultset('PendingOrganisation')->find({ name => $nameToTestJunon })->id;
|
||||||
print "Junon Id: " . $newPendingJunonOrgId . "\n";
|
print "Junon Id: " . $newPendingJunonOrgId . "\n";
|
||||||
|
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],3,"3 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 3, "3 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],4,"4 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 4, "4 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
|
|
||||||
print "test 12 - add valid transaction (type 2: unvalidated organisation)\n";
|
print "test 12 - add valid transaction (type 2: unvalidated organisation)\n";
|
||||||
$json = {
|
$json = {
|
||||||
|
@ -239,11 +222,10 @@ $upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jp
|
||||||
$t->post_ok('/api/upload' => form => $upload )
|
$t->post_ok('/api/upload' => form => $upload )
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],3,"3 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 3, "3 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],5,"5 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 5, "5 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
|
|
||||||
print "test 13 - add valid transaction (type 2: unvalidated organisation)\n";
|
print "test 13 - add valid transaction (type 2: unvalidated organisation)\n";
|
||||||
$json = {
|
$json = {
|
||||||
|
@ -256,11 +238,10 @@ $upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jp
|
||||||
$t->post_ok('/api/upload' => form => $upload )
|
$t->post_ok('/api/upload' => form => $upload )
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],3,"3 unverified organisations." ;
|
is $schema->resultset('PendingOrganisation')->count, 3, "3 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],6,"6 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 6, "6 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisations (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions." ;
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
|
|
||||||
|
|
||||||
print "test 14 - Logout Choco Billy\n";
|
print "test 14 - Logout Choco Billy\n";
|
||||||
$t->post_ok('/api/logout', json => { session_key => $session_key } )
|
$t->post_ok('/api/logout', json => { session_key => $session_key } )
|
||||||
|
@ -284,23 +265,23 @@ $t->post_ok('/api/login' => json => $testJson)
|
||||||
$session_key = $t->tx->res->json('/session_key');
|
$session_key = $t->tx->res->json('/session_key');
|
||||||
|
|
||||||
print "test 16 - Admin - Approve the correctly filled out organisation.\n";
|
print "test 16 - Admin - Approve the correctly filled out organisation.\n";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],3,"3 unverified organisations.";
|
is $schema->resultset('PendingOrganisation')->count, 3, "3 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],6,"6 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 6, "6 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],1,"1 verified organisation (choco billy)" ;
|
is $schema->resultset('Organisation')->count, 1, "1 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],0,"No verified transactions.";
|
is $schema->resultset('Transaction')->count, 0, "No verified transactions";
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgId,
|
pending_organisation_id => $newPendingTurtleOrgId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-approve' => json => $json)
|
$t->post_ok('/api/admin-approve' => json => $json)
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
|
|
||||||
my $turtleValidatedId = $t->app->schema->resultset('Organisation')->find({ name => $nameToTestTurtle })->organisationalid;
|
my $turtleValidatedId = $t->app->schema->resultset('Organisation')->find({ name => $nameToTestTurtle })->id;
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],2,"2 unverified organisations.";
|
is $schema->resultset('PendingOrganisation')->count, 2, "2 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],5,"5 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 5, "5 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],2,"2 verified organisations (choco billy and turtle)" ;
|
is $schema->resultset('Organisation')->count, 2, "2 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],1,"1 verified transaction.";
|
is $schema->resultset('Transaction')->count, 1, "1 verified transactions";
|
||||||
|
|
||||||
print "test 17 - Logout Admin\n";
|
print "test 17 - Logout Admin\n";
|
||||||
$t->post_ok('/api/logout', json => { session_key => $session_key } )
|
$t->post_ok('/api/logout', json => { session_key => $session_key } )
|
||||||
|
@ -325,14 +306,14 @@ $session_key = $t->tx->res->json('/session_key');
|
||||||
|
|
||||||
print "test 19 - Attempt to merge own unvalidated organisation with validated one and fails.\n";
|
print "test 19 - Attempt to merge own unvalidated organisation with validated one and fails.\n";
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgIdPartial,
|
pending_organisation_id => $newPendingTurtleOrgIdPartial,
|
||||||
validatedOrganisationId => $turtleValidatedId,
|
target_organisation_id => $turtleValidatedId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(403)
|
->status_is(403)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/You are not an admin/i);
|
->json_like('/message', qr/Not Authorised/i);
|
||||||
|
|
||||||
print "test 20 - Logout Choco Billy\n";
|
print "test 20 - Logout Choco Billy\n";
|
||||||
$t->post_ok('/api/logout', json => { session_key => $session_key })
|
$t->post_ok('/api/logout', json => { session_key => $session_key })
|
||||||
|
@ -362,98 +343,105 @@ $t->post_ok('/api/admin-merge' => json => {})
|
||||||
->json_like('/message', qr/JSON is missing/);
|
->json_like('/message', qr/JSON is missing/);
|
||||||
|
|
||||||
|
|
||||||
print "test 23 - unvalidatedOrganisationId missing.\n";
|
print "test 23 - pending_organisation_id missing.\n";
|
||||||
$json = {
|
$json = {
|
||||||
validatedOrganisationId => $turtleValidatedId,
|
target_organisation_id => $turtleValidatedId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/unvalidatedOrganisationId is missing/i);
|
->json_like('/message', qr/pending_organisation_id is missing/i);
|
||||||
|
|
||||||
|
|
||||||
print "test 24 - unvalidatedOrganisationId not number.\n";
|
print "test 24 - pending_organisation_id not number.\n";
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => "ABC",
|
pending_organisation_id => "ABC",
|
||||||
validatedOrganisationId => $turtleValidatedId,
|
target_organisation_id => $turtleValidatedId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/unvalidatedOrganisationId does not look like a number/i);
|
->content_like(qr/pending_organisation_id is not a number/i);
|
||||||
|
|
||||||
|
|
||||||
print "test 25 - validatedOrganisationId missing.\n";
|
print "test 25 - target_organisation_id missing.\n";
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgIdPartial,
|
pending_organisation_id => $newPendingTurtleOrgIdPartial,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/validatedOrganisationId is missing/i);
|
->content_like(qr/target_organisation_id is missing/i);
|
||||||
|
|
||||||
|
|
||||||
print "test 26 - validatedOrganisationId not number.\n";
|
print "test 26 - target_organisation_id not number.\n";
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgIdPartial,
|
pending_organisation_id => $newPendingTurtleOrgIdPartial,
|
||||||
validatedOrganisationId => "ABC",
|
target_organisation_id => "ABC",
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/validatedOrganisationId does not look like a number/i);
|
->content_like(qr/target_organisation_id is not a number/i);
|
||||||
|
|
||||||
|
|
||||||
print "test 27 - unvalidatedOrganisationId does not exist.\n";
|
print "test 27 - pending_organisation_id does not exist.\n";
|
||||||
my ($maxPendingId) = $t->app->db->selectrow_array("SELECT MAX(PendingOrganisationId) FROM PendingOrganisations", undef,());
|
my $maxPendingId = $schema->resultset('PendingOrganisation')->get_column('id')->max;
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => ($maxPendingId + 1),
|
pending_organisation_id => ($maxPendingId + 1),
|
||||||
validatedOrganisationId => $turtleValidatedId,
|
target_organisation_id => $turtleValidatedId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/unvalidatedOrganisationId does not exist in the database/i);
|
->content_like(qr/pending_organisation_id does not exist in the database/i);
|
||||||
|
|
||||||
|
|
||||||
print "test 28 - validatedOrganisationId does not exist.\n";
|
print "test 28 - target_organisation_id does not exist.\n";
|
||||||
my ($maxId) = $t->app->db->selectrow_array("SELECT MAX(OrganisationalId) FROM Organisations", undef,());
|
my $maxId = $schema->resultset('Organisation')->get_column('id')->max;
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgIdPartial,
|
pending_organisation_id => $newPendingTurtleOrgIdPartial,
|
||||||
validatedOrganisationId => ($maxId + 1),
|
target_organisation_id => ($maxId + 1),
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(400)
|
->status_is(400)
|
||||||
->json_is('/success', Mojo::JSON->false)
|
->json_is('/success', Mojo::JSON->false)
|
||||||
->content_like(qr/validatedOrganisationId does not exist in the database/i);
|
->content_like(qr/target_organisation_id does not exist in the database/i);
|
||||||
|
|
||||||
|
my $turtle_result = $schema->resultset('Organisation')->find($turtleValidatedId);
|
||||||
my ($name, $fullAddress, $postCode) = $t->app->db->selectrow_array("SELECT Name, FullAddress, PostCode FROM Organisations WHERE OrganisationalId = ?", undef, ($turtleValidatedId));
|
my $old_name = $turtle_result->name;
|
||||||
|
my $old_street_name = $turtle_result->street_name;
|
||||||
|
my $old_postcode = $turtle_result->postcode;
|
||||||
|
my $old_town = $turtle_result->town;
|
||||||
|
|
||||||
print "test 29 - valid merge.\n";
|
print "test 29 - valid merge.\n";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],2,"2 unverified organisations.";
|
is $schema->resultset('PendingOrganisation')->count, 2, "2 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],5,"5 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 5, "5 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],2,"2 verified organisations (choco billy and turtle)" ;
|
is $schema->resultset('Organisation')->count, 2, "2 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],1,"1 verified transaction.";
|
is $schema->resultset('Transaction')->count, 1, "1 verified transactions";
|
||||||
|
is $turtle_result->transactions->count, 1, '1 transactions for turtle';
|
||||||
$json = {
|
$json = {
|
||||||
unvalidatedOrganisationId => $newPendingTurtleOrgIdPartial,
|
pending_organisation_id => $newPendingTurtleOrgIdPartial,
|
||||||
validatedOrganisationId => $turtleValidatedId,
|
target_organisation_id => $turtleValidatedId,
|
||||||
session_key => $session_key,
|
session_key => $session_key,
|
||||||
};
|
};
|
||||||
$t->post_ok('/api/admin-merge' => json => $json)
|
$t->post_ok('/api/admin-merge' => json => $json)
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->json_is('/success', Mojo::JSON->true);
|
->json_is('/success', Mojo::JSON->true);
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingOrganisations", undef, ())}[0],1,"1 unverified organisation." ;
|
is $schema->resultset('PendingOrganisation')->count, 1, "1 unverified organisations";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM PendingTransactions", undef, ())}[0],3,"3 unverified transactions." ;
|
is $schema->resultset('PendingTransaction')->count, 3, "3 unverified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations", undef, ())}[0],2,"2 verified organisations (choco billy and turtle)" ;
|
is $schema->resultset('Organisation')->count, 2, "2 verified organisation";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions", undef, ())}[0],3,"3 verified transactions." ;
|
is $schema->resultset('Transaction')->count, 3, "3 verified transactions";
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Transactions WHERE SellerOrganisationId_FK = ?", undef, ($turtleValidatedId))}[0],3,"3 verified transactions." ;
|
is $turtle_result->transactions->count, 3, '3 transactions for turtle';
|
||||||
is @{$t->app->db->selectrow_arrayref("SELECT COUNT(*) FROM Organisations WHERE OrganisationalId = ? AND Name = ? AND FullAddress = ? AND PostCode = ?", undef, ($turtleValidatedId, $name, $fullAddress, $postCode))}[0],1,"Turtle exists with all orginal values.";
|
is $turtle_result->name, $old_name, 'name unchanged';
|
||||||
|
is $turtle_result->town, $old_town, 'town unchanged';
|
||||||
|
is $turtle_result->postcode, $old_postcode, 'postcode unchanged';
|
||||||
|
is $turtle_result->street_name, $old_street_name, 'street_name unchanged';
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
|
Reference in a new issue