mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00: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:
@@ -1,6 +1,6 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::SelfHostingControllerTest < ActionDispatch::IntegrationTest
|
||||
class Settings::HostingsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
ENV["SELF_HOSTING_ENABLED"] = "true"
|
||||
sign_in users(:family_admin)
|
||||
@@ -9,14 +9,14 @@ class Settings::SelfHostingControllerTest < ActionDispatch::IntegrationTest
|
||||
test "cannot edit when self hosting is disabled" do
|
||||
ENV["SELF_HOSTING_ENABLED"] = "false"
|
||||
|
||||
get edit_settings_self_hosting_url
|
||||
get settings_hosting_url
|
||||
assert :not_found
|
||||
|
||||
patch settings_self_hosting_url, params: { setting: { render_deploy_hook: "https://example.com" } }
|
||||
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 edit_settings_self_hosting_url
|
||||
get settings_hosting_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ class Settings::SelfHostingControllerTest < ActionDispatch::IntegrationTest
|
||||
NEW_RENDER_DEPLOY_HOOK = "https://api.render.com/deploy/srv-abc123"
|
||||
assert_nil Setting.render_deploy_hook
|
||||
|
||||
patch settings_self_hosting_url, params: { setting: { render_deploy_hook: NEW_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
|
||||
11
test/controllers/settings/notifications_controller_test.rb
Normal file
11
test/controllers/settings/notifications_controller_test.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::NotificationsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:family_admin)
|
||||
end
|
||||
test "get" do
|
||||
get settings_notifications_url
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
11
test/controllers/settings/preferences_controller_test.rb
Normal file
11
test/controllers/settings/preferences_controller_test.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::PreferencesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:family_admin)
|
||||
end
|
||||
test "get" do
|
||||
get settings_preferences_url
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
11
test/controllers/settings/profiles_controller_test.rb
Normal file
11
test/controllers/settings/profiles_controller_test.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::ProfilesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in @user = users(:family_admin)
|
||||
end
|
||||
test "get" do
|
||||
get settings_profile_url
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
11
test/controllers/settings/securities_controller_test.rb
Normal file
11
test/controllers/settings/securities_controller_test.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::SecuritiesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:family_admin)
|
||||
end
|
||||
test "get" do
|
||||
get settings_security_url
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user