Skip to content

Commit 7154c0c

Browse files
committed
create test "clear_completed/2" to bump coverage back up to 100% dwyl/phoenix-todo-list-tutorial#35 (comment)
1 parent c63a394 commit 7154c0c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/app_web/controllers/item_controller_test.exs

+11
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ defmodule AppWeb.ItemControllerTest do
100100
end
101101
end
102102

103+
describe "clear_completed/2" do
104+
setup [:create_item]
105+
106+
test "clear_completed/2", %{conn: conn, item: item} do
107+
get(conn, Routes.item_path(conn, :toggle, item.id))
108+
conn = get(conn, Routes.item_path(conn, :clear_completed))
109+
updated_item = App.Todo.get_item!(item.id)
110+
assert updated_item.status == 2
111+
end
112+
end
113+
103114
defp create_item(_) do
104115
item = fixture(:item)
105116
%{item: item}

0 commit comments

Comments
 (0)