summaryrefslogtreecommitdiffstats
path: root/test/db/auth.sql
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-07-16 18:16:29 -0700
committersadbeast <sadbeast@sadbeast.com>2024-10-05 16:40:55 -0700
commit6bd24af2ffbea91db1b10a5d5258980ce2068c7f (patch)
tree66634833f2d45260be5fcaf9111400eda12f03cc /test/db/auth.sql
downloadteamdraft-6bd24af2ffbea91db1b10a5d5258980ce2068c7f.tar.gz
teamdraft-6bd24af2ffbea91db1b10a5d5258980ce2068c7f.tar.bz2
let's goHEADmain
Diffstat (limited to 'test/db/auth.sql')
-rw-r--r--test/db/auth.sql18
1 files changed, 18 insertions, 0 deletions
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;