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;
