Mercurial > gemma
comparison tap_tests.sql @ 112:894f633e2d3f
WIP: Add failing test.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 15 Jun 2018 20:20:44 +0200 |
parents | c86b20edb398 |
children |
comparison
equal
deleted
inserted
replaced
111:767f3edc502c | 112:894f633e2d3f |
---|---|
3 -- | 3 -- |
4 BEGIN; | 4 BEGIN; |
5 | 5 |
6 CREATE EXTENSION pgtap; | 6 CREATE EXTENSION pgtap; |
7 | 7 |
8 SELECT plan(9); -- Give number of tests that have to be run | 8 SELECT plan(10); -- Give number of tests that have to be run |
9 | 9 |
10 SET search_path TO public, wamos, wamos_waterway, wamos_fairway; | 10 SET search_path TO public, wamos, wamos_waterway, wamos_fairway; |
11 | 11 |
12 \i tap_tests_data.sql | 12 \i tap_tests_data.sql |
13 | 13 |
64 SELECT throws_ok('EXECUTE bn_insert(''test2'', | 64 SELECT throws_ok('EXECUTE bn_insert(''test2'', |
65 ST_geomfromtext(''POLYGON((1 0, 1 1, 2 1, 2 0, 1 0))'', | 65 ST_geomfromtext(''POLYGON((1 0, 1 1, 2 1, 2 0, 1 0))'', |
66 4326))', 42501, NULL, | 66 4326))', 42501, NULL, |
67 'Waterway admin cannot insert data outside his region'); | 67 'Waterway admin cannot insert data outside his region'); |
68 | 68 |
69 -- XXX: Why does this fail? POLICY manage_templates should allow to see | |
70 -- the template of waterway_user. | |
71 SELECT isnt_empty('SELECT * FROM templates t | |
72 JOIN user_templates ut ON t.id = template_id | |
73 WHERE username <> current_user', | |
74 'Waterway admin should see templates of users in country'); | |
75 | |
69 -- | 76 -- |
70 -- finish tests | 77 -- finish tests |
71 -- | 78 -- |
72 SELECT * FROM finish(); | 79 SELECT * FROM finish(); |
73 | 80 |