Skip to content

Commit

Permalink
Change test environment for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrlpz committed Oct 28, 2024
1 parent 6cc8e1b commit 4e4860b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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."
Expand Down

0 comments on commit 4e4860b

Please sign in to comment.