Add integration tests for scheduled post filtering in Phoenix
This commit is contained in:
parent
8d40e09e90
commit
74a1201b88
@ -1,6 +1,29 @@
|
|||||||
defmodule FirehoseWeb.BlogControllerTest do
|
defmodule FirehoseWeb.BlogControllerTest do
|
||||||
use FirehoseWeb.ConnCase, async: false
|
use FirehoseWeb.ConnCase, async: false
|
||||||
|
|
||||||
|
describe "GET /blog/:blog_id (index) - date filtering" do
|
||||||
|
test "does not show future-dated posts", %{conn: conn} do
|
||||||
|
conn = get(conn, ~p"/blog/engineering")
|
||||||
|
html = html_response(conn, 200)
|
||||||
|
refute html =~ "Future Test Post"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET /blog/:blog_id/:slug (show) - date filtering" do
|
||||||
|
test "still shows a future-dated post by slug", %{conn: conn} do
|
||||||
|
conn = get(conn, ~p"/blog/engineering/future-test-post")
|
||||||
|
assert html_response(conn, 200) =~ "Future Test Post"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET /blog/:blog_id/tag/:tag - date filtering" do
|
||||||
|
test "excludes future-dated posts from tag page", %{conn: conn} do
|
||||||
|
conn = get(conn, ~p"/blog/engineering/tag/test")
|
||||||
|
html = html_response(conn, 200)
|
||||||
|
refute html =~ "Future Test Post"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "GET /blog/:blog_id/:slug - status banners" do
|
describe "GET /blog/:blog_id/:slug - status banners" do
|
||||||
test "authenticated user sees draft banner on draft post", %{conn: conn} do
|
test "authenticated user sees draft banner on draft post", %{conn: conn} do
|
||||||
conn =
|
conn =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user