DEV: Default to `development` RAILS_ENV when running theme tests (#13106)

When testing theme components in development, it doesn't make sense to use the `test` environment. The `test` environment almost certainly has 0 themes installed.

This change still works fine when using the `themes:install_and_test` rake task, because that rake task explicitly specifies environment/database-config.
This commit is contained in:
David Taylor 2021-05-24 13:35:10 +01:00 committed by GitHub
parent c62efc0f0f
commit 93ae1b2b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -114,6 +114,7 @@ task "themes:qunit", :type, :value do |t, args|
MSG MSG
end end
ENV["THEME_#{type.upcase}"] = value.to_s ENV["THEME_#{type.upcase}"] = value.to_s
ENV["QUNIT_RAILS_ENV"] ||= 'development' # qunit:test will switch to `test` by default
Rake::Task["qunit:test"].reenable Rake::Task["qunit:test"].reenable
Rake::Task["qunit:test"].invoke(1200000, "/theme-qunit") Rake::Task["qunit:test"].invoke(1200000, "/theme-qunit")
end end