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

New Settings Menu, Routes and Controllers Organization (#641)

* Add new settings routes and controllers

* Add new settings view, restructure controllers and routes

* Fix lint errors
This commit is contained in:
Zach Gollwitzer 2024-04-18 07:56:51 -04:00 committed by GitHub
parent 39d57a167e
commit 9bda7efc3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 771 additions and 203 deletions

View file

@ -0,0 +1,31 @@
require "test_helper"
class Settings::HostingsControllerTest < ActionDispatch::IntegrationTest
setup do
ENV["SELF_HOSTING_ENABLED"] = "true"
sign_in users(:family_admin)
end
test "cannot edit when self hosting is disabled" do
ENV["SELF_HOSTING_ENABLED"] = "false"
get settings_hosting_url
assert :not_found
patch settings_hosting_url, params: { setting: { render_deploy_hook: "https://example.com" } }
assert :not_found
end
test "should get edit when self hosting is enabled" do
get settings_hosting_url
assert_response :success
end
test "can update settings when self hosting is enabled" do
NEW_RENDER_DEPLOY_HOOK = "https://api.render.com/deploy/srv-abc123"
assert_nil Setting.render_deploy_hook
patch settings_hosting_url, params: { setting: { render_deploy_hook: NEW_RENDER_DEPLOY_HOOK } }
assert_equal NEW_RENDER_DEPLOY_HOOK, Setting.render_deploy_hook
end
end