pinchflat/test/pinchflat_web/controllers/setting_controller_test.exs
Kieran 8a0ae89bc0
[Enhancement] Add Apprise support (#170)
* [WIP] add settings sidebar entry and placeholder page

* [WIP] added placeholder UI and logic for settings form

* Added column and UI for apprise server

* Add some tests

* Added placeholder command runner for apprise

* [WIP] Adding apprise package

* Added apprise command runner

* Hooked up apprise notification module

* Ensured apprise was running in verbose mode

* Updated wording of apprise notification

* Added apprise to README
2024-04-09 09:45:39 -07:00

23 lines
655 B
Elixir

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