Skip to content

Business intelligence made simple

Added test for smart variables [skip ci]

Andrew Kaneead2a4fc036c
diff --git a/test/internal/config/blazer.yml b/test/internal/config/blazer.yml
index b7861944..c5d2dfeb 100644
--- a/test/internal/config/blazer.yml
+++ b/test/internal/config/blazer.yml
@@ -23,7 +23,7 @@ data_sources:
smart_variables:
# zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
- # period: ["day", "week", "month"]
+ period: ["day", "week", "month"]
# status: {0: "Active", 1: "Archived"}
linked_columns:
diff --git a/test/queries_test.rb b/test/queries_test.rb
index 96821b2b..deb6df5e 100644
--- a/test/queries_test.rb
+++ b/test/queries_test.rb
@@ -56,6 +56,15 @@ class QueriesTest < ActionDispatch::IntegrationTest
assert_response :success
end
+ def test_smart_variables
+ query = create_query(statement: "SELECT {period}")
+ get blazer.query_path(query)
+ assert_response :success
+ assert_match "day", response.body
+ assert_match "week", response.body
+ assert_match "month", response.body
+ end
+
def test_linked_columns
run_query "SELECT 123 AS user_id"
assert_match "/admin/users/123", response.body