Add test for change plan page

This commit is contained in:
Uku Taht 2019-10-25 14:51:54 +08:00
parent 396faa4bcd
commit 9dd08ddfa6

View File

@ -5,6 +5,13 @@ defmodule PlausibleWeb.BillingControllerTest do
describe "GET /change-plan" do
setup [:create_user, :log_in]
test "shows change plan page if user has subsription", %{conn: conn, user: user} do
insert(:subscription, user: user)
conn = get(conn, "/billing/change-plan")
assert html_response(conn, 200) =~ "Change subscription plan"
end
test "redirects to /upgrade if user does not have a subscription", %{conn: conn} do
conn = get(conn, "/billing/change-plan")