From 4e4860bc639545691a31a5ca407b6fd2fba6d886 Mon Sep 17 00:00:00 2001 From: Alejandro Rueda Date: Mon, 28 Oct 2024 11:20:59 +0100 Subject: [PATCH] Change test environment for CI --- Rakefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Rakefile b/Rakefile index f2b9b18..2a6a90f 100644 --- a/Rakefile +++ b/Rakefile @@ -10,6 +10,16 @@ def install_module(path) end end +def change_file_content(path, file_path, old_content, new_content) + Dir.chdir(path) do + file_data = File.read(file_path) + file_data.gsub!(old_content, new_content) + File.open(file_path, "w") do |file| + file.puts(file_data) + end + end +end + def seed_db(path) Dir.chdir(path) do system("bundle exec rake db:seed") @@ -20,6 +30,7 @@ desc "Generates a dummy app for testing" task test_app: "decidim:generate_external_test_app" do ENV["RAILS_ENV"] = "test" install_module("spec/decidim_dummy_app") + change_file_content("spec/decidim_dummy_app", "config/environments/test.rb", "config.cache_classes = true", "config.cache_classes = false") end desc "Generates a development app."