Skip to content

Commit

Permalink
fix(test): change name to check if insert test works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
danimarinBG committed Aug 13, 2024
1 parent cd55240 commit 6238c93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/upsert/ws/test_doc_type.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ SELECT plan(4);

-- 1. INSERT
INSERT INTO doc_type (id, comment)
VALUES ('AS_BUILT', 'test');
SELECT is((SELECT count(*) FROM doc_type WHERE id = 'AS_BUILT'), 1, 'INSERT: doc_type AS_BUILT was inserted');
VALUES ('AS_BUILT2', 'test');
SELECT is((SELECT count(*) FROM doc_type WHERE id = 'AS_BUILT2'), 1, 'INSERT: doc_type AS_BUILT2 was inserted');

-- 2. UPDATE
UPDATE doc_type SET id = 'WORK REPORT', comment = 'No comments' WHERE id='WORK RAPPORT';
SELECT is((SELECT id FROM doc_type WHERE employee_id = 'WORK REPORT'), 'WORK REPORT', 'UPDATE: doc_type WORK RAPPORT was updated to WORK REPORT');

-- 3. UPSERT
INSERT INTO doc_type (id, comment)
VALUES ('AS_BUILT', 'No comments');
VALUES ('AS_BUILT2', 'No comments');
ON CONFLICT (id) DO UPDATE
SET comment = EXCLUDED.comment;
SELECT is((SELECT comment FROM doc_type WHERE id = 'AS_BUILT'), 'No comments', 'UPSERT: doc_type comment was updated to No comments using ON CONFLICT');
SELECT is((SELECT comment FROM doc_type WHERE id = 'AS_BUILT2'), 'No comments', 'UPSERT: doc_type comment was updated to No comments using ON CONFLICT');

-- 4. DELETE
DELETE FROM doc_type WHERE id='PICTURE';
Expand Down

0 comments on commit 6238c93

Please sign in to comment.