1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 07:09:39 +02:00

Pull out in_hosted_app helper

This commit is contained in:
Jose Farias 2024-02-02 19:48:45 -06:00
parent 3852b79121
commit 78c84c5028
No known key found for this signature in database
GPG key ID: 877CF7E5FFD0FB3F

View file

@ -16,8 +16,7 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
end
test "create when hosted requires an invite code" do
ENV["HOSTED"] = "true"
in_hosted_app do
assert_no_difference "User.count" do
post registration_url, params: { user: {
email: "john@example.com",
@ -41,6 +40,14 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
invite_code: InviteCode.generate! } }
assert_redirected_to root_url
end
end
end
private
def in_hosted_app
ENV["HOSTED"] = "true"
yield
ensure
ENV["HOSTED"] = nil
end