Compare commits
No commits in common. "34d1589d677251f960d2ca55a5ce1915f3948882" and "60cfb137f233f499df94bffc8b9175965f1b4aa7" have entirely different histories.
34d1589d67
...
60cfb137f2
BIN
.nono.sh.swp
BIN
.nono.sh.swp
Binary file not shown.
4
Makefile
4
Makefile
@ -5,7 +5,7 @@
|
||||
# Common check target that runs all static analysis
|
||||
check:
|
||||
@echo "Running static analysis..."
|
||||
@make -C app MISE_BIN=mise check
|
||||
@make -C app MISE_BIN=/home/vscode/.local/bin/mise check
|
||||
|
||||
# Precommit target for CI/pre-commit hooks
|
||||
precommit: check
|
||||
@ -24,4 +24,4 @@ test:
|
||||
|
||||
# Format code
|
||||
format:
|
||||
@make -C app format
|
||||
@make -C app format
|
||||
@ -24,11 +24,7 @@ defmodule Firehose.Checks.NoConnShadowing do
|
||||
|> Enum.reverse()
|
||||
end
|
||||
|
||||
defp traverse(
|
||||
{:=, meta, [{:conn, _, _}, {verb, _, [{:conn, _, _} | _]}]} = ast,
|
||||
issues,
|
||||
issue_meta
|
||||
)
|
||||
defp traverse({:=, meta, [{:conn, _, _}, {verb, _, [{:conn, _, _} | _]}]} = ast, issues, issue_meta)
|
||||
when verb in @http_verbs do
|
||||
issue = issue_for(issue_meta, meta[:line], verb)
|
||||
{ast, [issue | issues]}
|
||||
@ -41,8 +37,7 @@ defmodule Firehose.Checks.NoConnShadowing do
|
||||
defp issue_for(issue_meta, line_no, verb) do
|
||||
format_issue(
|
||||
issue_meta,
|
||||
message:
|
||||
"Conn shadowing detected (`conn = #{verb}(conn, ...)`). Run `./refactor_conn_aliasing.sh <file>` to fix.",
|
||||
message: "Conn shadowing detected (`conn = #{verb}(conn, ...)`). Run `./refactor_conn_aliasing.sh <file>` to fix.",
|
||||
line_no: line_no
|
||||
)
|
||||
end
|
||||
|
||||
@ -3,8 +3,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
|
||||
defp goto_engineering_tag_page(conn, tag) do
|
||||
path = "/blog/engineering/tag/#{tag}"
|
||||
conn_res = get(conn, path)
|
||||
body = html_response(conn_res, 200)
|
||||
conn = get(conn, path)
|
||||
body = html_response(conn, 200)
|
||||
assert body =~ ~s(tagged "#{tag}")
|
||||
assert body =~ "Engineering Blog"
|
||||
body
|
||||
@ -12,8 +12,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
|
||||
defp goto_releases_tag_page(conn, tag) do
|
||||
path = "/blog/releases/tag/#{tag}"
|
||||
conn_res = get(conn, path)
|
||||
body = html_response(conn_res, 200)
|
||||
conn = get(conn, path)
|
||||
body = html_response(conn, 200)
|
||||
assert body =~ ~s(tagged "#{tag}")
|
||||
assert body =~ "Release Notes"
|
||||
body
|
||||
@ -33,8 +33,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
test "GET /blog/engineering/tag/:tag page shows empty list for nonexistent tag", %{
|
||||
conn: conn
|
||||
} do
|
||||
conn_res = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
body = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(body, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
end
|
||||
end
|
||||
|
||||
@ -45,30 +45,30 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
end
|
||||
|
||||
test "GET /blog/releases/tag/:tag page shows filtered posts", %{conn: conn} do
|
||||
conn_res = get(conn, "/blog/releases/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
body = get(conn, "/blog/releases/tag/nonexistent-tag")
|
||||
assert html_response(body, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
end
|
||||
end
|
||||
|
||||
describe "tag URL pattern" do
|
||||
test "tag URLs follow pattern /blog/:blog_id/tag/:tag for engineering blog", %{conn: conn} do
|
||||
# Test that the tag route exists and works correctly
|
||||
conn_res1 = get(conn, "/blog/engineering/tag/elixir")
|
||||
assert html_response(conn_res1, 200) =~ ~s(tagged "elixir")
|
||||
conn = get(conn, "/blog/engineering/tag/elixir")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "elixir")
|
||||
|
||||
conn_res2 = get(conn, "/blog/engineering/tag/phoenix")
|
||||
assert html_response(conn_res2, 200) =~ ~s(tagged "phoenix")
|
||||
conn = get(conn, "/blog/engineering/tag/phoenix")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "phoenix")
|
||||
end
|
||||
|
||||
test "tag URLs follow pattern /blog/:blog_id/tag/:tag for releases blog", %{conn: conn} do
|
||||
# Test that the tag route exists and works correctly
|
||||
conn_res = get(conn, "/blog/releases/tag/release")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "release")
|
||||
conn = get(conn, "/blog/releases/tag/release")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "release")
|
||||
end
|
||||
|
||||
test "nonexistent tags return 200 with empty post list", %{conn: conn} do
|
||||
conn_res = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200)
|
||||
conn = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn, 200)
|
||||
end
|
||||
end
|
||||
|
||||
@ -94,30 +94,30 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
test "tags are rendered as clickable links on engineering blog index", %{
|
||||
conn: conn
|
||||
} do
|
||||
conn_res1 = get(conn, "/blog/engineering")
|
||||
body1 = html_response(conn_res1, 200)
|
||||
conn = get(conn, "/blog/engineering")
|
||||
body = html_response(conn, 200)
|
||||
|
||||
# Verify tag links exist with correct href pattern
|
||||
assert body1 =~ ~r{href="/blog/engineering/tag/meta"}
|
||||
assert body1 =~ ~r{href="/blog/engineering/tag/ai"}
|
||||
assert body =~ ~r{href="/blog/engineering/tag/meta"}
|
||||
assert body =~ ~r{href="/blog/engineering/tag/ai"}
|
||||
end
|
||||
|
||||
test "tags are rendered as clickable links on releases blog index", %{
|
||||
conn: conn
|
||||
} do
|
||||
conn_res2 = get(conn, "/blog/releases")
|
||||
body2 = html_response(conn_res2, 200)
|
||||
conn = get(conn, "/blog/releases")
|
||||
body = html_response(conn, 200)
|
||||
|
||||
# Verify tag link exists
|
||||
assert body2 =~ ~r{href="/blog/releases/tag/release"}
|
||||
assert body =~ ~r{href="/blog/releases/tag/release"}
|
||||
end
|
||||
|
||||
test "tag links have proper styling classes", %{conn: conn} do
|
||||
conn_res3 = get(conn, "/blog/engineering")
|
||||
body3 = html_response(conn_res3, 200)
|
||||
conn = get(conn, "/blog/engineering")
|
||||
body = html_response(conn, 200)
|
||||
|
||||
# Verify blogex-tag-link class is present for tag links
|
||||
assert body3 =~ ~r{class="[^"]*blogex-tag-link}
|
||||
assert body =~ ~r{class="[^"]*blogex-tag-link}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user