Browse Source

test: fix topic tests

main
Inhji Y. 8 months ago
parent
commit
b9bf41508c
  1. 6
      test/mirage/notes_test.exs
  2. 4
      test/mirage_web/controllers/topic_controller_test.exs

6
test/mirage/notes_test.exs

@ -83,7 +83,9 @@ defmodule Mirage.NotesTest do
assert {:ok, %Note{} = note} = Notes.update_note(note, attrs)
assert note.content ==
"some updated content with a reference [[#{note.id}|Link to myself]] [[#{note.id + 1}]]"
"some updated content with a reference [[#{note.id}|Link to myself]] [[#{
note.id + 1
}]]"
assert note.content_html =~ "Link to myself"
end
@ -123,7 +125,7 @@ defmodule Mirage.NotesTest do
end
test "list_topics/0 returns all topics" do
topic = topic_fixture()
topic = topic_fixture() |> Notes.preload_topic()
assert Notes.list_topics() == [topic]
end

4
test/mirage_web/controllers/topic_controller_test.exs

@ -17,7 +17,7 @@ defmodule MirageWeb.TopicControllerTest do
describe "index" do
test "lists all topics", %{conn: conn} do
conn = get(conn, Routes.topic_path(conn, :index))
assert html_response(conn, 200) =~ "Listing Note topics"
assert html_response(conn, 200) =~ "Listing Topics"
end
end
@ -36,7 +36,7 @@ defmodule MirageWeb.TopicControllerTest do
assert redirected_to(conn) == Routes.topic_path(conn, :show, id)
conn = get(conn, Routes.topic_path(conn, :show, id))
assert html_response(conn, 200) =~ "Show Note topic"
assert html_response(conn, 200) =~ "Topic some text"
end
test "renders errors when data is invalid", %{conn: conn} do

Loading…
Cancel
Save