Start testing Mihainator.Extractor

This commit is contained in:
2024-10-23 22:42:31 +02:00
parent 278e151eef
commit 777c14dae0
2 changed files with 31 additions and 8 deletions

View File

@@ -0,0 +1,31 @@
defmodule Mihainator.ExtractorTest do
@moduledoc false
use ExUnit.Case, async: true
alias Mihainator.Extractor
@test_file Path.join([File.cwd!(), "data", "test.csv"])
test "should get a full year of sorted months" do
expected = [
"2021-12",
"2022-01",
"2022-02",
"2022-03",
"2022-04",
"2022-05",
"2022-06",
"2022-07",
"2022-08",
"2022-09",
"2022-10",
"2022-11",
"2022-12"
]
result = Extractor.extract(@test_file)
assert Map.keys(result) == expected
end
end

View File

@@ -1,8 +0,0 @@
defmodule MihainatorWeb.PageControllerTest do
use MihainatorWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, ~p"/")
assert html_response(conn, 200) =~ "Peace of mind from prototype to production"
end
end