Stopped Orgs from buying for themselves & added to test
This commit is contained in:
parent
5452dac826
commit
a463b99fa9
2 changed files with 31 additions and 3 deletions
|
@ -464,4 +464,19 @@ $t->post_ok('/api/upload' => form => $upload )
|
|||
->json_like('/message', qr/Upload Successful/);
|
||||
is $schema->resultset('Transaction')->count, 6, "6 transaction";
|
||||
|
||||
print "test 31 - organisation buy from same organisation\n";
|
||||
$json = {
|
||||
transaction_value => 100000,
|
||||
transaction_type => 1,
|
||||
purchase_time => $test_purchase_time,
|
||||
organisation_id => 2,
|
||||
session_key => $session_key,
|
||||
};
|
||||
$upload = {json => Mojo::JSON::encode_json($json), file => {file => './t/test.jpg'}};
|
||||
$t->post_ok('/api/upload' => form => $upload )
|
||||
->status_is(400)
|
||||
->json_is('/success', Mojo::JSON->false)
|
||||
->json_like('/message', qr/organisation_id does not exist in the database/);
|
||||
is $schema->resultset('Transaction')->count, 6, "6 transaction";
|
||||
|
||||
done_testing();
|
||||
|
|
Reference in a new issue