Skip to content

Commit

Permalink
Added test for variable defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Apr 18, 2022
1 parent 6ea18c2 commit 5210aac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/internal/config/blazer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ data_sources:
# user_id: "SELECT id, name FROM users WHERE id IN {value}"
status: {0: "Active", 1: "Archived"}

variable_defaults:
default_var: default_value

athena:
adapter: athena
database: blazer_test
Expand Down
7 changes: 7 additions & 0 deletions test/queries_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def test_variables_time_range
assert_match "daterangepicker", response.body
end

def test_variable_defaults
query = create_query(statement: "SELECT {default_var}")
get blazer.query_path(query)
assert_response :success
assert_match "default_value", response.body
end

def test_smart_variables
query = create_query(statement: "SELECT {period}")
get blazer.query_path(query)
Expand Down

0 comments on commit 5210aac

Please sign in to comment.