From 6bd24af2ffbea91db1b10a5d5258980ce2068c7f Mon Sep 17 00:00:00 2001 From: sadbeast Date: Tue, 16 Jul 2024 18:16:29 -0700 Subject: let's go --- test/db/auth.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/db/auth.sql (limited to 'test/db/auth.sql') diff --git a/test/db/auth.sql b/test/db/auth.sql new file mode 100644 index 0000000..f19aff1 --- /dev/null +++ b/test/db/auth.sql @@ -0,0 +1,18 @@ +BEGIN; +SELECT plan(8); + +SELECT has_table('accounts'); +SELECT columns_are('accounts', ARRAY[ 'account_id', 'status_id', 'email', 'name', 'modified_at', 'created_at']); +SELECT has_sequence('accounts_account_id_seq'); +SELECT has_index('teamdraft', 'accounts', 'accounts_pk', 'account_id'); + +SELECT create_account('sadbEASt@sadbeast.com', 'hunter2') new_user_id \gset + +SELECT is(0, (select count(1) FROM accounts WHERE email = 'sadbEASt@sadbeast.com')::int); +SELECT is(1, (select count(1) FROM accounts WHERE email = 'sadbeast@sadbeast.com')::int); +SELECT is(:'new_user_id', (select account_id FROM accounts WHERE email = 'sadbeast@sadbeast.com')::int); + +SELECT has_extension('pgsodium', 'pgsodium', 'pgsodium extension installed'); + +SELECT * FROM finish(); +ROLLBACK; -- cgit v1.2.3