mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 23:04:31 +08:00
DEV: Fix broken request/qunit_controller_spec.rb
(#32376)
This test file fails locally if `tmp/theme-transpiler.js` does not exists. Since the test file stubs the production env, we have to ensure that `DiscourseJsProcessor::Transpiler.build_production_theme_transpiler` is run first to mirror the production environment where the theme transpiler file is built as part of assets precompilation. ### Review notes: Example failure: https://github.com/discourse/discourse/actions/runs/14529161497/job/40766003075 To repro locally, run the following steps: 1. In your Discourse directory, run `rm -rf tmp` 2. `rspec spec/requests/qunit_controller_spec.rb`
This commit is contained in:
parent
d524bbd339
commit
2ec0bf32da
@ -10,6 +10,11 @@ RSpec.describe QunitController do
|
||||
Rails.env.stubs(:production?).returns(true)
|
||||
end
|
||||
|
||||
# rubocop:disable RSpec/BeforeAfterAll
|
||||
before(:all) { DiscourseJsProcessor::Transpiler.build_production_theme_transpiler }
|
||||
|
||||
after(:all) { File.delete(DiscourseJsProcessor::Transpiler::TRANSPILER_PATH) }
|
||||
|
||||
it "hides page for regular users in production" do
|
||||
production_sign_in(Fabricate(:user))
|
||||
get "/theme-qunit"
|
||||
|
Loading…
x
Reference in New Issue
Block a user