Business intelligence made simple
Test urls and images [skip ci]
Andrew Kane2689f1e71008
diff --git a/test/internal/config/blazer.yml b/test/internal/config/blazer.ymlindex c5d2dfeb..6f7700cf 100644--- a/test/internal/config/blazer.yml+++ b/test/internal/config/blazer.yml@@ -65,7 +65,7 @@ audit: truefrom_email: [email protected]# webhook for Slack-slack_webhook_url: http://localhost:5000+slack_webhook_url: http://localhost:3000check_schedules:- "1 day"diff --git a/test/queries_test.rb b/test/queries_test.rbindex 4e4dae9a..ed97db7c 100644--- a/test/queries_test.rb+++ b/test/queries_test.rb@@ -93,4 +93,25 @@ class QueriesTest < ActionDispatch::IntegrationTestrun_query("SELECT 1 AS id, 'Chicago' AS city", format: "csv")assert_equal "id,city\n1,Chicago\n", response.bodyend++ def test_url+ run_query "SELECT 'http://localhost:3000/'"+ assert_match %{<a target="_blank" href="http://localhost:3000/">http://localhost:3000/</a>}, response.body+ end++ def test_images_default+ run_query("SELECT 'http://localhost:3000/image.png'")+ refute_match %{<img referrerpolicy="no-referrer" src="http://localhost:3000/image.png" />}, response.body+ end++ def test_images+ previous_value = Blazer.images+ begin+ Blazer.images = true+ run_query("SELECT 'http://localhost:3000/image.png'")+ assert_match %{<img referrerpolicy="no-referrer" src="http://localhost:3000/image.png" />}, response.body+ ensure+ Blazer.images = previous_value+ end+ endend