Remove unnecessary condition in spec helper

This helper file is only loaded when system specs are loaded. So we
don't need to check for the absence of system specs because this file
wouldn't be loaded if there were not system specs to be run.
This commit is contained in:
Maikel Linke
2023-11-23 16:30:02 +11:00
parent bb0684bd23
commit 6431b94aba

View File

@@ -1,23 +1,12 @@
# frozen_string_literal: true
RSpec.configure do |config|
# Skip assets precompilcation if we exclude system specs.
# For example, you can run all non-system tests via the following command:
#
# rspec --tag ~type:system
#
# In this case, we don't need to precompile assets.
next if
config.filter.opposite.rules[:type] == "system" ||
config.exclude_pattern.match?(%r{spec/system})
config.before(:suite) do
# We can use webpack-dev-server for tests, too!
# Useful if you working on a frontend code fixes and want to verify them via system tests.
next if Webpacker.dev_server.running?
$stdout.puts "\n Precompiling assets.\n"
Webpacker.compile
end
end