defmodule PinchflatWeb.SettingControllerTest do use PinchflatWeb.ConnCase describe "show settings" do test "renders the page", %{conn: conn} do conn = get(conn, ~p"/settings") assert html_response(conn, 200) =~ "Settings" end end describe "update settings" do test "saves and redirects when data is valid", %{conn: conn} do update_attrs = %{apprise_server: "test://server"} conn = put(conn, ~p"/settings", setting: update_attrs) assert redirected_to(conn) == ~p"/settings" conn = get(conn, ~p"/settings") assert html_response(conn, 200) =~ update_attrs[:apprise_server] end end end