Commit
•
bf3825c
1
Parent(s):
778e209
chore: Format test files
Browse files
test/medical_transcription_web/controllers/error_html_test.exs
CHANGED
@@ -9,6 +9,7 @@ defmodule MedicalTranscriptionWeb.ErrorHTMLTest do
|
|
9 |
end
|
10 |
|
11 |
test "renders 500.html" do
|
12 |
-
assert render_to_string(MedicalTranscriptionWeb.ErrorHTML, "500", "html", []) ==
|
|
|
13 |
end
|
14 |
end
|
|
|
9 |
end
|
10 |
|
11 |
test "renders 500.html" do
|
12 |
+
assert render_to_string(MedicalTranscriptionWeb.ErrorHTML, "500", "html", []) ==
|
13 |
+
"Internal Server Error"
|
14 |
end
|
15 |
end
|
test/medical_transcription_web/controllers/error_json_test.exs
CHANGED
@@ -2,7 +2,9 @@ defmodule MedicalTranscriptionWeb.ErrorJSONTest do
|
|
2 |
use MedicalTranscriptionWeb.ConnCase, async: true
|
3 |
|
4 |
test "renders 404" do
|
5 |
-
assert MedicalTranscriptionWeb.ErrorJSON.render("404.json", %{}) == %{
|
|
|
|
|
6 |
end
|
7 |
|
8 |
test "renders 500" do
|
|
|
2 |
use MedicalTranscriptionWeb.ConnCase, async: true
|
3 |
|
4 |
test "renders 404" do
|
5 |
+
assert MedicalTranscriptionWeb.ErrorJSON.render("404.json", %{}) == %{
|
6 |
+
errors: %{detail: "Not Found"}
|
7 |
+
}
|
8 |
end
|
9 |
|
10 |
test "renders 500" do
|
test/support/data_case.ex
CHANGED
@@ -36,7 +36,9 @@ defmodule MedicalTranscription.DataCase do
|
|
36 |
Sets up the sandbox based on the test tags.
|
37 |
"""
|
38 |
def setup_sandbox(tags) do
|
39 |
-
pid =
|
|
|
|
|
40 |
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
|
41 |
end
|
42 |
|
|
|
36 |
Sets up the sandbox based on the test tags.
|
37 |
"""
|
38 |
def setup_sandbox(tags) do
|
39 |
+
pid =
|
40 |
+
Ecto.Adapters.SQL.Sandbox.start_owner!(MedicalTranscription.Repo, shared: not tags[:async])
|
41 |
+
|
42 |
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
|
43 |
end
|
44 |
|