Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
djmb committed Aug 22, 2024
1 parent 488a049 commit 5c67816
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion activejob/test/support/integration/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
dummy_app_path = Dir.mktmpdir + "/dummy"
dummy_app_template = File.expand_path("dummy_app_template.rb", __dir__)
args = Rails::Generators::ARGVScrubber.new(["new", dummy_app_path, "--skip-gemfile", "--skip-bundle",
"--skip-git", "-d", "sqlite3", "--skip-javascript", "--force", "--quiet",
"--skip-git", "-d", "sqlite3", "--skip-javascript", "--skip-solid-cache", "--force", "--quiet",
"--template", dummy_app_template]).prepare!
Rails::Generators::AppGenerator.start args

Expand Down
2 changes: 2 additions & 0 deletions railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"db/seeds.rb",
"lib/tasks/.keep",
"log/.keep",
"log/test.log",
"public/404.html",
"public/406-unsupported-browser.html",
"public/422.html",
Expand All @@ -82,6 +83,7 @@
"test/system/.keep",
"test/test_helper.rb",
"tmp/.keep",
"tmp/local_secret.txt",
"tmp/pids/.keep",
"tmp/storage/.keep",
"vendor/.keep"
Expand Down
10 changes: 5 additions & 5 deletions railties/test/generators/db_system_change_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ChangeGeneratorTest < Rails::Generators::TestCase
assert_not_includes content["containerEnv"].keys, "DB_HOST"
end

assert_cache_migration_files in: "db/cache/migrate", not_in: "db/migrate"
assert_cache_migration_files here: "db/cache/migrate", not_here: "db/migrate"
end

test "change to trilogy" do
Expand Down Expand Up @@ -186,7 +186,7 @@ class ChangeGeneratorTest < Rails::Generators::TestCase
assert_equal expected_mariadb_config, compose_config["services"]["mariadb"]
assert_includes compose_config["volumes"].keys, "mariadb-data"

assert_cache_migration_files in: "db/migrate", not_in: "db/cache/migrate"
assert_cache_migration_files here: "db/migrate", not_here: "db/cache/migrate"
end
end

Expand Down Expand Up @@ -224,9 +224,9 @@ class ChangeGeneratorTest < Rails::Generators::TestCase
end

private
def assert_cache_migration_files(in:, not_in)
assert_operator Dir.glob("#{in}/*.solid_cache.rb").size, :>, 1
assert_equal Dir.glob("#{not_in}/*.solid_cache.rb").size, 0
def assert_cache_migration_files(here:, not_here:)
assert_operator Dir.glob("#{here}/*.solid_cache.rb").size, :>, 1
assert_equal Dir.glob("#{not_here}/*.solid_cache.rb").size, 0
end
end
end
Expand Down

0 comments on commit 5c67816

Please sign in to comment.