From 4f48f276d052a6211be625d3b87d8077a789999c Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 5 Apr 2016 12:10:53 -0400 Subject: [PATCH] LP#1549505: PGTap test to show the infrastructure is working Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- ...549505_statistical_popularity_infrastructure.pg | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/regress/lp1549505_statistical_popularity_infrastructure.pg diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1549505_statistical_popularity_infrastructure.pg b/Open-ILS/src/sql/Pg/t/regress/lp1549505_statistical_popularity_infrastructure.pg new file mode 100644 index 0000000000..e5d44b7517 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/regress/lp1549505_statistical_popularity_infrastructure.pg @@ -0,0 +1,33 @@ +BEGIN; + +SELECT plan(1); + +INSERT INTO config.bib_source (id, source ) + VALUES (999999998, 'test source'); +INSERT INTO rating.badge (id, name, scope, popularity_parameter, src_filter) + VALUES (999999998, 'test badge', 1, 15, 999999998 ); + +INSERT INTO biblio.record_entry (id, source, last_xact_id, marc) +VALUES (999999998, 999999998, 'pgtap', $$ + 00531nam a2200157 a 4500 + 20080729170300.0 + t19981999enka 0 eng + + test record + +$$); + +SELECT rating.recalculate_badge_score(999999998); + +SELECT is( + score, 5, + 'LP#1549505: Badge caclulation framework is operational' +) +FROM rating.record_badge_score; +WHERE record = 999999998 +AND badge = 999999998; + +ROLLBACK; -- 2.11.0