From 8d018d996c1eddb882dc64ebbd228bb0135944f3 Mon Sep 17 00:00:00 2001
From: sadbeast <sadbeast@sadbeast.com>
Date: Sun, 23 Jun 2024 15:36:59 -0700
Subject: wtf

---
 test/leagues.sql | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 test/leagues.sql

(limited to 'test/leagues.sql')

diff --git a/test/leagues.sql b/test/leagues.sql
new file mode 100644
index 0000000..fc7c465
--- /dev/null
+++ b/test/leagues.sql
@@ -0,0 +1,21 @@
+BEGIN;
+SELECT plan(4);
+
+SELECT has_table('leagues');
+
+SELECT columns_are('leagues', ARRAY[ 'league_id', 'name', 'user_id', 'modified_at', 'created_at']);
+
+SELECT has_sequence('leagues_league_id_seq');
+
+SELECT has_index('teamdraft', 'leagues', 'leagues_pk', 'league_id');
+
+\set new_user_id 5 
+INSERT INTO users(user_id, username) OVERRIDING SYSTEM VALUE VALUES (5, 'test'); 
+\set new_league_id 5 
+INSERT INTO leagues(league_id, name, user_id) OVERRIDING SYSTEM VALUE VALUES (:new_league_id, 'test league', :new_user_id);
+
+CALL new_league_season(:new_league_id);
+
+SELECT * FROM finish();
+ROLLBACK;
+
-- 
cgit v1.2.3

