-- Test sex
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('sex');
select has_pk('sex');
select table_privs_are('sex', 'guest', array[]::text[]);
select table_privs_are('sex', 'employee', array['SELECT']);
select table_privs_are('sex', 'admin', array['SELECT']);
select table_privs_are('sex', 'authenticator', array[]::text[]);

select has_column('sex', 'sex_id');
select col_is_pk('sex', 'sex_id');
select col_type_is('sex', 'sex_id', 'character varying(1)');
select col_not_null('sex', 'sex_id');
select col_hasnt_default('sex', 'sex_id');

select has_column('sex', 'name');
select col_type_is('sex', 'name', 'text');
select col_not_null('sex', 'name');
select col_hasnt_default('sex', 'name');


select *
from finish();

rollback;
