Feature: OG Social media cards
Not Original Gangsta, but ObjectGraph Reason: images were showing on LinkedIn, but small.
This commit is contained in:
@@ -3,34 +3,35 @@
|
||||
defmodule FirehoseWeb.BlogTest do
|
||||
use FirehoseWeb.ConnCase
|
||||
|
||||
defp visit_engineering_page(conn, suffix \\ "") do
|
||||
path = "/blog/engineering" <> suffix
|
||||
defp visit_blog_page(conn, blog_id, suffix \\ "") do
|
||||
path = "/blog/#{blog_id}" <> suffix
|
||||
body = conn |> get(path) |> html_response(200)
|
||||
assert body =~ "Engineering Blog"
|
||||
assert body =~ "firehose"
|
||||
body
|
||||
end
|
||||
|
||||
defp visit_engineering_path(conn, suffix) do
|
||||
path = "/blog/engineering" <> suffix
|
||||
body = conn |> get(path) |> html_response(200)
|
||||
assert body =~ "firehose"
|
||||
body
|
||||
end
|
||||
|
||||
describe "engineering blog (HTML)" do
|
||||
test "GET /blog/engineering returns HTML index with layout", %{conn: conn} do
|
||||
visit_engineering_page(conn)
|
||||
body = visit_blog_page(conn, "engineering")
|
||||
assert body =~ "Engineering Blog"
|
||||
assert body =~ "firehose"
|
||||
end
|
||||
|
||||
test "GET /blog/engineering/:slug returns HTML post with layout", %{conn: conn} do
|
||||
body = visit_engineering_path(conn, "/hello-world")
|
||||
body = visit_blog_page(conn, "engineering", "/hello-world")
|
||||
assert body =~ "Hello World"
|
||||
end
|
||||
end
|
||||
|
||||
test "GET /blog/engineering/tag/:tag returns HTML tag page", %{conn: conn} do
|
||||
body = visit_engineering_path(conn, "/tag/elixir")
|
||||
assert body =~ ~s(tagged "elixir")
|
||||
describe "release notes blog (HTML)" do
|
||||
test "GET /blog/releases returns HTML index", %{conn: conn} do
|
||||
body = visit_blog_page(conn, "releases")
|
||||
assert body =~ "Release Notes"
|
||||
assert body =~ "v0.1.0 Released"
|
||||
end
|
||||
|
||||
test "GET /blog/releases/:slug returns HTML post", %{conn: conn} do
|
||||
body = visit_blog_page(conn, "releases", "/v0-1-0")
|
||||
assert body =~ "v0.1.0 Released"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,24 +59,6 @@ defmodule FirehoseWeb.BlogTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "release notes blog (HTML)" do
|
||||
test "GET /blog/releases returns HTML index", %{conn: conn} do
|
||||
body = conn |> get("/blog/releases") |> html_response(200)
|
||||
assert body =~ "Release Notes"
|
||||
assert body =~ "v0.1.0 Released"
|
||||
end
|
||||
|
||||
test "GET /blog/releases/:slug returns HTML post", %{conn: conn} do
|
||||
body = conn |> get("/blog/releases/v0-1-0") |> html_response(200)
|
||||
assert body =~ "v0.1.0 Released"
|
||||
end
|
||||
|
||||
test "GET /blog/releases/tag/:tag returns HTML tag page", %{conn: conn} do
|
||||
body = conn |> get("/blog/releases/tag/elixir") |> html_response(200)
|
||||
assert body =~ ~s(tagged "elixir")
|
||||
end
|
||||
end
|
||||
|
||||
describe "engineering blog (JSON API)" do
|
||||
test "GET /api/blog/engineering returns post index", %{conn: conn} do
|
||||
assert %{"blog" => "engineering", "posts" => posts} =
|
||||
|
||||
Reference in New Issue
Block a user