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:
parent
3852b79121
commit
78c84c5028
1 changed files with 31 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue