diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2a8fd34..44587da 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,11 @@ - <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%# + Only the built file (bun run build:css). `:app` also linked the Tailwind source, whose + `@import "tailwindcss"` 404s in the browser, and tailwindcss-rails' copy of the same styles. + %> + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %> diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb index 67c3a97..21ec0e8 100644 --- a/test/controllers/sessions_controller_test.rb +++ b/test/controllers/sessions_controller_test.rb @@ -11,6 +11,13 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest assert_includes response.body, "Sign in to Stash" end + test "the layout links only the built stylesheet" do + get sign_in_path + + assert_select "link[rel=stylesheet]", count: 1 + assert_select "link[rel=stylesheet][href^=?]", "/assets/application-" + end + test "the Weave button submits without Turbo, so the browser follows the redirect to Weave" do with_fake_weave do get sign_in_path