summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Location.sql2
-rw-r--r--sql/modules/test/Company.sql35
2 files changed, 36 insertions, 1 deletions
diff --git a/sql/modules/Location.sql b/sql/modules/Location.sql
index 4a257e28..cd86dea1 100644
--- a/sql/modules/Location.sql
+++ b/sql/modules/Location.sql
@@ -158,7 +158,7 @@ CREATE TYPE location_result AS (
state text,
mail_code text,
country text,
- location_class text
+ class text
);
CREATE OR REPLACE FUNCTION location__get(in_id int) returns location_result AS $$
diff --git a/sql/modules/test/Company.sql b/sql/modules/test/Company.sql
new file mode 100644
index 00000000..fa95b32a
--- /dev/null
+++ b/sql/modules/test/Company.sql
@@ -0,0 +1,35 @@
+BEGIN;
+\i Base.sql
+
+INSERT INTO test_result (test_name, success)
+SELECT 'Saving Company',
+ company_save (NULL, 'TESTING...', 1,'TESTING', 'TESTING', NULL, '1234')
+ IS NOT NULL;
+
+
+INSERT INTO test_result (test_name, success)
+SELECT 'Saving Credit Acct',
+ entity_credit_save( NULL , 1, currval('entity_id_seq')::int, 'TEST', 0, false,
+ 0, 0, 0, 'test-123', NULL, NULL, NULL, 'USD', now()::date, now()::date,
+ 0, NULL, NULL)
+ IS NOT NULL;
+
+INSERT INTO test_result (test_name, success)
+SELECT 'eca_location_save',
+ eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 2, 'Test', 'Test',
+ NULL, 'Test', 'Test', '12345', 25)
+ IS NOT NULL;
+
+INSERT INTO test_result (test_name, success)
+SELECT 'list_locations', count(*) > 0
+ FROM eca__list_locations(currval('entity_credit_account_id_seq')::int);
+
+
+SELECT * FROM test_result;
+
+SELECT (select count(*) from test_result where success is true)
+|| ' tests passed and '
+|| (select count(*) from test_result where success is not true)
+|| ' failed' as message;
+
+ROLLBACK;