Skip to content

Commit

Permalink
add initializer to test_app task
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeig committed Oct 21, 2024
1 parent e10824e commit e703ac5
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
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "decidim/dev/common_rake"
require "fileutils"

def install_module(path)
Dir.chdir(path) do
Expand All @@ -9,6 +10,15 @@ def install_module(path)
end
end

def install_initializer(path, _env)
Dir.chdir(path) do
FileUtils.cp(
"#{__dir__}/lib/generators/decidim/app_templates/#env}/initializer.rb",
"config/initializers/decidim_term_customizer_config.rb"
)
end
end

def seed_db(path)
Dir.chdir(path) do
system("bundle exec rake db:seed")
Expand All @@ -18,6 +28,7 @@ end
desc "Generates a dummy app for testing"
task test_app: "decidim:generate_external_test_app" do
ENV["RAILS_ENV"] = "test"
install_initializer("spec/decidim_dummy_app", "test")
install_module("spec/decidim_dummy_app")
end

Expand Down

0 comments on commit e703ac5

Please sign in to comment.