File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
test/lib/code_corps/messages Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,23 @@ defmodule CodeCorps.MessagesTest do
242242 assert result . id == conversation . id
243243 end
244244 end
245+
246+ describe "update_conversation/2" do
247+ @ reopened "reopned"
248+
249+ test "creates a conversation_part of part_type reopened when reopened" do
250+ conversation = insert ( :conversation )
251+
252+ assert Repo . aggregate ( ConversationPart , :count , :id ) == 0
253+
254+ conversation = Messages . get_conversation ( conversation . id )
255+
256+ updated = Messages . update_conversation ( conversation , % { status: "reopened" } )
257+
258+ assert Repo . aggregate ( ConversationPart , :count , :id ) == 1
259+ assert Repo . get_by ( ConversationPart , part_type: "reopened" )
260+ end
261+ end
245262
246263 describe "get_part/1" do
247264 test "gets a single part" do
You can’t perform that action at this time.
0 commit comments