Skip to content

Business intelligence made simple

Improved tests [skip ci]

Andrew Kane67c2b63698e4
diff --git a/test/queries_test.rb b/test/queries_test.rb
index 1c8b8ab5..2fe1d7c0 100644
--- a/test/queries_test.rb
+++ b/test/queries_test.rb
@@ -7,13 +7,25 @@ class QueriesTest < ActionDispatch::IntegrationTest
Blazer::Query.delete_all
end
- def test_index
+ def test_home
create_query
get blazer.root_path
assert_response :success
assert_match "Test", response.body
end
+ def test_index
+ get blazer.queries_path
+ assert_redirected_to blazer.root_path
+ end
+
+ def test_index_json
+ create_query
+ get blazer.queries_path, as: :json
+ assert_response :success
+ assert_match "Test", response.body
+ end
+
def test_create
post blazer.queries_path, params: {query: {name: "Test", statement: "SELECT 1", data_source: "main"}}
query = Blazer::Query.last