Test environment stability improvements (#703)

* Add climate_control gem and test helper

* Replace ENV mods in upgrades test

* Replace ENV mods in registrations test

* Remove ENV references in hostings controller

* Update ENV refs in mailer test

* ActiveStorage cleanup

* Consolidate queue config so appropriate adapter runs in test environment

* Make test environment more explicit

* Centralize self hosting config

* Remove flaky system test
This commit is contained in:
Zach Gollwitzer
2024-05-02 13:18:18 -04:00
committed by GitHub
parent 98df7ccb11
commit 5dfbba403a
14 changed files with 137 additions and 137 deletions

View File

@@ -25,7 +25,7 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
end
test "create when hosted requires an invite code" do
in_invited_app do
with_env_overrides REQUIRE_INVITE_CODE: "true" do
assert_no_difference "User.count" do
post registration_url, params: { user: {
email: "john@example.com",
@@ -51,13 +51,4 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
end
end
end
private
def in_invited_app
ENV["REQUIRE_INVITE_CODE"] = "true"
yield
ensure
ENV["REQUIRE_INVITE_CODE"] = nil
end
end