rails/tailwindcss-rails

is it possible that tailwindcss-rails somehow overrides the spec generator?

thisIsLoading opened this issue · 2 comments

hi,

i created a new rails 8 app via rails new myapp --database=postgresql --css tailwind, it installed tailwind 4.

for some wierd reasons after installing rsepc and put this into the application.rb:

    config.generators do |g|
      g.test_framework :rspec, fixture: true
      g.fixture_replacement :factory_bot, dir: 'spec/factories'
    end

it creates spec files like views/pages/home.html.tailwindcss_spec.rb

when creating a new controller with an action via rails g controller pages home

      create  app/controllers/pages_controller.rb
       route  get "pages/home"
      invoke  tailwindcss
      create    app/views/pages
      create    app/views/pages/home.html.erb
      invoke  rspec
      create    spec/requests/pages_spec.rb
      create    spec/views/pages
      create    spec/views/pages/home.html.tailwindcss_spec.rb
      invoke  helper
      create    app/helpers/pages_helper.rb
      invoke    rspec
      create      spec/helpers/pages_helper_spec.rb

which is kinda weird

anyone an idea what i miss?

hi @thisIsLoading, that spec is being created by rspec-rails. See this generator.

There's a hint in your output: it invokes rspec, which creates 2 files: spec/requests/pages_spec.rb, spec/views/pages/home.html.tailwindcss_spec.rb.

Closing since I think everything is functioning as designed. Let me know if that's not the case.