Sha256: f8672102b2584bac2e0bd60a2f029509dc6add90f9a14458a6c3152ea9ca4ca0
Contents?: true
Size: 1.47 KB
Versions: 18
Compression:
Stored size: 1.47 KB
Contents
BEGIN; SELECT PLAN(10); SELECT col_not_null('dummy_landable', 'authors', 'email', 'email is not null'); SELECT col_not_null('dummy_landable', 'authors', 'username', 'usernameis not null'); SELECT col_not_null('dummy_landable', 'authors', 'first_name', 'first_name is not null'); SELECT col_not_null('dummy_landable', 'authors', 'last_name', 'last_name is not null'); SELECT col_is_pk('dummy_landable', 'authors', 'author_id', 'author_id is PK'); --Verify unique index on email SELECT lives_ok($$INSERT INTO dummy_landable.authors (email, username, first_name, last_name) VALUES ('jdoe@test.com', 'jdoe', 'john', 'doe')$$); SELECT throws_matching($$INSERT INTO dummy_landable.authors (email, username, first_name, last_name) VALUES ('jdoe@test.com', 'jdoe', 'john', 'doe')$$, 'violates unique constraint'); SELECT throws_matching($$INSERT INTO dummy_landable.authors (email, username, first_name, last_name) VALUES ('JDOE@test.com', 'jdoe', 'john', 'doe')$$, 'violates unique constraint', 'email is case insensitive'); --Verify unique index on username SELECT throws_matching($$INSERT INTO dummy_landable.authors (email, username, first_name, last_name) VALUES ('jdoe2@test.com', 'jdoe', 'john', 'doe')$$, 'violates unique constraint', 'unique username'); SELECT lives_ok($$INSERT INTO dummy_landable.authors (email, username, first_name, last_name) VALUES ('jdoe2@test.com', 'JDoe', 'john', 'doe')$$, 'unique username is case insensitive'); SELECT * FROM finish(); ROLLBACK;
Version data entries
18 entries across 18 versions & 1 rubygems