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/drafts.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/db/drafts.sql (limited to 'test/db/drafts.sql') diff --git a/test/db/drafts.sql b/test/db/drafts.sql new file mode 100644 index 0000000..1e63362 --- /dev/null +++ b/test/db/drafts.sql @@ -0,0 +1,15 @@ +BEGIN; +SELECT plan(5); + +SELECT has_table('drafts'); +SELECT columns_are('drafts', ARRAY[ 'draft_id', 'season_id', 'draft_status_id', 'name', 'account_id', 'started_at', 'modified_at', 'created_at']); +SELECT has_sequence('drafts_draft_id_seq'); +SELECT has_index('teamdraft', 'drafts', 'drafts_pk', 'draft_id'); + +INSERT INTO seasons (league_id, started_at, ended_at) VALUES (1, now() - interval '1 day', now() + interval '3 months') RETURNING season_id new_season_id \gset +SELECT create_draft(1, 'sadbeast', 'freckles', now() + interval '3 days') new_session_id \gset +SELECT is(1, (SELECT count(1)::int FROM account_active_session_keys WHERE session_id = :'new_session_id')); + +SELECT * FROM finish(); +ROLLBACK; + -- cgit v1.2.3