From df7f4d0a31addd018c512f85d383598ec8551a01 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 21 Jul 2021 16:25:20 +0100 Subject: [PATCH] Removed some unecessary comments --- .../support/better_rails_system_tests.rb | 6 --- spec/system/support/precompile_assets.rb | 40 ------------------- 2 files changed, 46 deletions(-) diff --git a/spec/system/support/better_rails_system_tests.rb b/spec/system/support/better_rails_system_tests.rb index 7b4ed4be25..1d859e2b3a 100644 --- a/spec/system/support/better_rails_system_tests.rb +++ b/spec/system/support/better_rails_system_tests.rb @@ -14,12 +14,6 @@ module BetterRailsSystemTests Capybara.using_session(Capybara.last_used_session) { super } end - - ## Use relative path in screenshot message - ##def image_path - ## absolute_image_path.relative_path_from(Rails.root).to_s - ##end - end RSpec.configure do |config| diff --git a/spec/system/support/precompile_assets.rb b/spec/system/support/precompile_assets.rb index 7d6d7ccdeb..413969e0b6 100644 --- a/spec/system/support/precompile_assets.rb +++ b/spec/system/support/precompile_assets.rb @@ -22,44 +22,4 @@ RSpec.configure do |config| end end -=begin - -# frozen_string_literal: true - -# Precompile assets before running tests to avoid timeouts. -# Do not precompile if webpack-dev-server is running (NOTE: MUST be launched with RAILS_ENV=test) -RSpec.configure do |config| - config.before(:suite) do - examples = RSpec.world.filtered_examples.values.flatten - has_no_system_tests = examples.none? { |example| example.metadata[:type] == :system } - - if has_no_system_tests - $stdout.puts "\n🚀️️ No system test selected. Skip assets compilation.\n" - next - end - - if Webpacker.dev_server.running? - $stdout.puts "\n⚙️ Webpack dev server is running! Skip assets compilation.\n" - next - else - $stdout.puts "\n🐢 Precompiling assets.\n" - original_stdout = $stdout.clone - # Use test-prof now 'cause it couldn't be monkey-patched (e.g., by Timecop or similar) - start = Time.current - begin - # Silence Webpacker output - $stdout.reopen(File.new("/dev/null", "w")) - # next 3 lines to compile webpacker before running our test suite - require "rake" - Rails.application.load_tasks - Rake::Task["webpacker:compile"].execute - ensure - $stdout.reopen(original_stdout) - $stdout.puts "Finished in #{(Time.current - start).round(2)} seconds" - end - end - end -end - -=end