-- Test quote_contact
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;

begin;

select plan(19);

set search_path to numerus, public;

select has_table('quote_contact');
select has_pk('quote_contact' );
select table_privs_are('quote_contact', 'guest', array []::text[]);
select table_privs_are('quote_contact', 'invoicer', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_contact', 'admin', array ['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('quote_contact', 'authenticator', array []::text[]);

select has_column('quote_contact', 'quote_id');
select col_is_pk('quote_contact', 'quote_id');
select col_is_fk('quote_contact', 'quote_id');
select fk_ok('quote_contact', 'quote_id', 'quote', 'quote_id');
select col_type_is('quote_contact', 'quote_id', 'integer');
select col_not_null('quote_contact', 'quote_id');
select col_hasnt_default('quote_contact', 'quote_id');

select has_column('quote_contact', 'contact_id');
select col_is_fk('quote_contact', 'contact_id');
select fk_ok('quote_contact', 'contact_id', 'contact', 'contact_id');
select col_type_is('quote_contact', 'contact_id', 'integer');
select col_not_null('quote_contact', 'contact_id');
select col_hasnt_default('quote_contact', 'contact_id');


select *
from finish();

rollback;

