WIP microprints source now showing
also added go to install showboat and rodney for the next steps. microprints work in qwan tracker, but not in firehose. some of the rendering is in the project, maybe the library should provide sample webpages.
This commit is contained in:
@@ -103,7 +103,8 @@ defmodule FirehoseWeb.BlogControllerTest do
|
||||
test "meta tags have correct og_url", %{conn: conn} do
|
||||
response = conn |> get(~p"/blog/engineering/hello-world") |> html_response(200)
|
||||
|
||||
assert response =~ ~s(<meta property="og:url" content="http://localhost:4002/blog/engineering/hello-world")
|
||||
assert response =~
|
||||
~s(<meta property="og:url" content="http://localhost:4002/blog/engineering/hello-world")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
defmodule FirehoseWeb.MicroprintsLiveTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
describe "scan_source_files/0" do
|
||||
test "returns only .ex files from app/ and blogex/ directories" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
# Should include app/lib files
|
||||
assert "lib/firehose.ex" in files
|
||||
end
|
||||
|
||||
test "does not include files from _build/ directory" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
refute Enum.any?(files, &String.starts_with?(&1, "_build/"))
|
||||
end
|
||||
|
||||
test "does not include files from deps/ directory" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
refute Enum.any?(files, &String.starts_with?(&1, "deps/"))
|
||||
end
|
||||
|
||||
test "does not include files from examples/ directory" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
refute Enum.any?(files, &String.contains?(&1, "/examples/"))
|
||||
end
|
||||
|
||||
test "does not include test files" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
refute Enum.any?(files, &String.contains?(&1, "/test/"))
|
||||
end
|
||||
|
||||
test "paths are relative (no leading slash or absolute path)" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
refute Enum.any?(files, &String.starts_with?(&1, "/"))
|
||||
end
|
||||
|
||||
test "app paths do not contain source dir prefix" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
app_files = Enum.filter(files, &String.starts_with?(&1, "lib/"))
|
||||
refute Enum.any?(app_files, &String.starts_with?(&1, "app/"))
|
||||
end
|
||||
|
||||
test "blogex paths start with ../blogex/" do
|
||||
files = FirehoseWeb.MicroprintsLive.scan_source_files()
|
||||
|
||||
blogex_files = Enum.filter(files, &String.starts_with?(&1, "../blogex/"))
|
||||
refute blogex_files == []
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user