From 2e46c590c4c72b6d41e5eb498a778b6e86ce64f0 Mon Sep 17 00:00:00 2001 From: Inhji Date: Tue, 7 Mar 2023 23:03:10 +0100 Subject: [PATCH] update tests to accommodate for post kind being enum --- test/chiya/notes_test.exs | 8 ++++---- test/chiya_web/controllers/note_controller_test.exs | 4 ++-- test/support/fixtures/notes_fixtures.ex | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/chiya/notes_test.exs b/test/chiya/notes_test.exs index 757828c..c1366e3 100644 --- a/test/chiya/notes_test.exs +++ b/test/chiya/notes_test.exs @@ -22,7 +22,7 @@ defmodule Chiya.NotesTest do test "create_note/1 with valid data creates a note" do valid_attrs = %{ content: "some content", - kind: "some kind", + kind: "post", name: "some name", published_at: ~N[2023-03-04 16:22:00], slug: "some slug", @@ -31,7 +31,7 @@ defmodule Chiya.NotesTest do assert {:ok, %Note{} = note} = Notes.create_note(valid_attrs) assert note.content == "some content" - assert note.kind == "some kind" + assert note.kind == :post assert note.name == "some name" assert note.published_at == ~N[2023-03-04 16:22:00] assert note.slug == "some slug" @@ -47,7 +47,7 @@ defmodule Chiya.NotesTest do update_attrs = %{ content: "some updated content", - kind: "some updated kind", + kind: "bookmark", name: "some updated name", published_at: ~N[2023-03-05 16:22:00], slug: "some updated slug", @@ -56,7 +56,7 @@ defmodule Chiya.NotesTest do assert {:ok, %Note{} = note} = Notes.update_note(note, update_attrs) assert note.content == "some updated content" - assert note.kind == "some updated kind" + assert note.kind == :bookmark assert note.name == "some updated name" assert note.published_at == ~N[2023-03-05 16:22:00] assert note.slug == "some updated slug" diff --git a/test/chiya_web/controllers/note_controller_test.exs b/test/chiya_web/controllers/note_controller_test.exs index acf8cdc..ac118da 100644 --- a/test/chiya_web/controllers/note_controller_test.exs +++ b/test/chiya_web/controllers/note_controller_test.exs @@ -5,7 +5,7 @@ defmodule ChiyaWeb.NoteControllerTest do @create_attrs %{ content: "some content", - kind: "some kind", + kind: "post", name: "some name", published_at: ~N[2023-03-04 16:22:00], slug: "some slug", @@ -13,7 +13,7 @@ defmodule ChiyaWeb.NoteControllerTest do } @update_attrs %{ content: "some updated content", - kind: "some updated kind", + kind: "bookmark", name: "some updated name", published_at: ~N[2023-03-05 16:22:00], slug: "some updated slug", diff --git a/test/support/fixtures/notes_fixtures.ex b/test/support/fixtures/notes_fixtures.ex index 43381e1..8594cfb 100644 --- a/test/support/fixtures/notes_fixtures.ex +++ b/test/support/fixtures/notes_fixtures.ex @@ -17,7 +17,7 @@ defmodule Chiya.NotesFixtures do attrs |> Enum.into(%{ content: "some content", - kind: "some kind", + kind: "post", name: "some name", published_at: ~N[2023-03-04 16:22:00], slug: unique_note_slug(),