update blog post, and run credo with 'pi'

This commit is contained in:
2026-03-18 15:03:24 +00:00
parent 9be7c1774b
commit 3837a72059
15 changed files with 165 additions and 19 deletions
@@ -74,7 +74,7 @@ defmodule FirehoseWeb.BlogTest do
conn = get(conn, "/api/blog/engineering")
assert %{"blog" => "engineering", "posts" => posts} = json_response(conn, 200)
assert is_list(posts)
assert length(posts) > 0
refute Enum.empty?(posts)
end
test "GET /api/blog/engineering/:slug returns a post", %{conn: conn} do
@@ -99,7 +99,7 @@ defmodule FirehoseWeb.BlogTest do
conn = get(conn, "/api/blog/releases")
assert %{"blog" => "release_notes", "posts" => posts} = json_response(conn, 200)
assert is_list(posts)
assert length(posts) > 0
refute Enum.empty?(posts)
end
test "GET /api/blog/releases/:slug returns a post", %{conn: conn} do
+3 -2
View File
@@ -18,6 +18,7 @@ defmodule Firehose.DataCase do
using do
quote do
alias Ecto.Adapters.SQL.Sandbox
alias Firehose.Repo
import Ecto
@@ -36,8 +37,8 @@ defmodule Firehose.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Firehose.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(Firehose.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
end
@doc """