36 lines
1.0 KiB
PL/PgSQL
36 lines
1.0 KiB
PL/PgSQL
-- Test booking_status
|
|
set client_min_messages to warning;
|
|
create extension if not exists pgtap;
|
|
reset client_min_messages;
|
|
|
|
begin;
|
|
|
|
select plan(15);
|
|
|
|
set search_path to camper, public;
|
|
|
|
select has_table('booking_status');
|
|
select has_pk('booking_status');
|
|
select table_privs_are('booking_status', 'guest', array[]::text[]);
|
|
select table_privs_are('booking_status', 'employee', array['SELECT']);
|
|
select table_privs_are('booking_status', 'admin', array['SELECT']);
|
|
select table_privs_are('booking_status', 'authenticator', array[]::text[]);
|
|
|
|
select has_column('booking_status', 'booking_status');
|
|
select col_is_pk('booking_status', 'booking_status');
|
|
select col_type_is('booking_status', 'booking_status', 'text');
|
|
select col_not_null('booking_status', 'booking_status');
|
|
select col_hasnt_default('booking_status', 'booking_status');
|
|
|
|
select has_column('booking_status', 'name');
|
|
select col_type_is('booking_status', 'name', 'text');
|
|
select col_not_null('booking_status', 'name');
|
|
select col_hasnt_default('booking_status', 'name');
|
|
|
|
|
|
select *
|
|
from finish();
|
|
|
|
rollback;
|
|
|