mirror of
https://github.com/we-promise/sure.git
synced 2026-04-14 01:24:06 +00:00
Add onboarding state selector for self-hosted signup (#251)
* Add onboarding modes to self-hosted signup * Style form consistently * Configure ONBOARDING_STATE via ENV
This commit is contained in:
@@ -26,7 +26,7 @@ class Settings::HostingsControllerTest < ActionDispatch::IntegrationTest
|
||||
get settings_hosting_url
|
||||
assert_response :forbidden
|
||||
|
||||
patch settings_hosting_url, params: { setting: { require_invite_for_signup: true } }
|
||||
patch settings_hosting_url, params: { setting: { onboarding_state: "invite_only" } }
|
||||
assert_response :forbidden
|
||||
end
|
||||
end
|
||||
@@ -48,6 +48,20 @@ class Settings::HostingsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
|
||||
test "can update onboarding state when self hosting is enabled" do
|
||||
with_self_hosting do
|
||||
patch settings_hosting_url, params: { setting: { onboarding_state: "invite_only" } }
|
||||
|
||||
assert_equal "invite_only", Setting.onboarding_state
|
||||
assert Setting.require_invite_for_signup
|
||||
|
||||
patch settings_hosting_url, params: { setting: { onboarding_state: "closed" } }
|
||||
|
||||
assert_equal "closed", Setting.onboarding_state
|
||||
refute Setting.require_invite_for_signup
|
||||
end
|
||||
end
|
||||
|
||||
test "can update openai access token when self hosting is enabled" do
|
||||
with_self_hosting do
|
||||
patch settings_hosting_url, params: { setting: { openai_access_token: "token" } }
|
||||
|
||||
Reference in New Issue
Block a user