[Housekeeping] Refactor settings model (#165)
* [WIP] renamed current settings module and tables to have backup suffix * Created new settings table, schema, and context * Migrated from old settings module to new one * Removed settings backup modules * Added some tests and docs
This commit is contained in:
@@ -13,7 +13,7 @@ defmodule PinchflatWeb.SourceControllerTest do
|
||||
|
||||
setup do
|
||||
media_profile = media_profile_fixture()
|
||||
Settings.set!(:onboarding, false)
|
||||
Settings.set(onboarding: false)
|
||||
|
||||
{
|
||||
:ok,
|
||||
@@ -47,7 +47,7 @@ defmodule PinchflatWeb.SourceControllerTest do
|
||||
end
|
||||
|
||||
test "renders correct layout when onboarding", %{conn: conn} do
|
||||
Settings.set!(:onboarding, true)
|
||||
Settings.set(onboarding: true)
|
||||
conn = get(conn, ~p"/sources/new")
|
||||
|
||||
refute html_response(conn, 200) =~ "MENU"
|
||||
@@ -74,14 +74,14 @@ defmodule PinchflatWeb.SourceControllerTest do
|
||||
test "redirects to onboarding when onboarding", %{conn: conn, create_attrs: create_attrs} do
|
||||
expect(YtDlpRunnerMock, :run, 1, &runner_function_mock/3)
|
||||
|
||||
Settings.set!(:onboarding, true)
|
||||
Settings.set(onboarding: true)
|
||||
conn = post(conn, ~p"/sources", source: create_attrs)
|
||||
|
||||
assert redirected_to(conn) == ~p"/?onboarding=1"
|
||||
end
|
||||
|
||||
test "renders correct layout on error when onboarding", %{conn: conn, invalid_attrs: invalid_attrs} do
|
||||
Settings.set!(:onboarding, true)
|
||||
Settings.set(onboarding: true)
|
||||
conn = post(conn, ~p"/sources", source: invalid_attrs)
|
||||
|
||||
refute html_response(conn, 200) =~ "MENU"
|
||||
|
||||
Reference in New Issue
Block a user