From 74c58f6698e8d4e03e37a6453aff35cf3fe154ad Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Wed, 21 Jan 2026 17:08:24 -0500 Subject: [PATCH 1/2] Don't use config.asset_host for GraphQL::Dashboard assets --- .../layouts/graphql/dashboard/application.html.erb | 10 +++++----- spec/dummy/config/application.rb | 1 + .../controllers/dashboard/landings_controller_test.rb | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb b/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb index 7c53122ba8..1b38cb5d5a 100644 --- a/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +++ b/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb @@ -5,11 +5,11 @@ GraphQL Dashboard <%= content_for?(:title) ? " ยท #{content_for(:title)}" : "" %> - <%= stylesheet_link_tag graphql_dashboard.static_path("bootstrap-5.3.3.min.css") %> - <%= stylesheet_link_tag graphql_dashboard.static_path("charts.min.css") %> - <%= stylesheet_link_tag graphql_dashboard.static_path("dashboard.css") %> - <%= javascript_include_tag graphql_dashboard.static_path("bootstrap-5.3.3.min.js") %> - <%= javascript_include_tag graphql_dashboard.static_path("dashboard.js") %> + " media="screen" /> + " media="screen" /> + " media="screen" /> + + <%= csrf_meta_tags %> diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 147ae683d6..cb63d0237b 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -19,5 +19,6 @@ module Dummy class Application < Rails::Application # Don't generate system test files. config.generators.system_tests = nil + config.asset_host = "http://some.cdn" end end diff --git a/spec/dummy/test/controllers/dashboard/landings_controller_test.rb b/spec/dummy/test/controllers/dashboard/landings_controller_test.rb index 97fd9822bc..9fc0fbb5e0 100644 --- a/spec/dummy/test/controllers/dashboard/landings_controller_test.rb +++ b/spec/dummy/test/controllers/dashboard/landings_controller_test.rb @@ -2,9 +2,10 @@ require "test_helper" class DashboardLandingsControllerTest < ActionDispatch::IntegrationTest - def test_it_shows_a_landing_page + def test_it_shows_a_landing_page_with_local_static_asset_links get graphql_dashboard.root_path assert_includes response.body, "Welcome to the GraphQL-Ruby Dashboard" + assert_includes response.body, '', "it doesn't use config.asset_host" end def test_it_shows_version_and_schema_info From 179a4e18db506355c0d3b322e69b6dcf7e3285c3 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Thu, 22 Jan 2026 08:19:07 -0500 Subject: [PATCH 2/2] Fix system tests now that config.asset_host is set --- spec/dummy/app/views/layouts/application.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb index 465617889d..ff78061195 100644 --- a/spec/dummy/app/views/layouts/application.html.erb +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -3,7 +3,9 @@ Dummy <%= csrf_meta_tags %> - <%= javascript_include_tag 'application' %> + <%= + javascript_include_tag 'application', host: "" # work around config.asset_host which is set to test dashboard + %>