File tree Expand file tree Collapse file tree 3 files changed +16
-112
lines changed
test/lib/code_corps/github/sync Expand file tree Collapse file tree 3 files changed +16
-112
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -246,6 +246,22 @@ defmodule CodeCorps.GitHub.SyncTest do
246246 assert comment . user_id == comment_user . id
247247 assert comment . user . github_id == comment_user_github_id
248248 end
249+
250+ test "syncs correctly when comment deleted" do
251+ % { "comment" => % { "id" => github_id } } = payload =
252+ load_event_fixture ( "issue_comment_deleted" )
253+
254+ github_comment = insert ( :github_comment , github_id: github_id )
255+ comment = insert ( :comment , github_comment: github_comment )
256+
257+ { :ok , % { deleted_comments: [ deleted_comment ] , deleted_github_comment: deleted_github_comment } }
258+ = payload |> Sync . issue_comment_event ( )
259+
260+ assert deleted_comment . id == comment . id
261+ assert deleted_github_comment . id == github_comment . id
262+ assert Repo . aggregate ( Comment , :count , :id ) == 0
263+ assert Repo . aggregate ( GithubComment , :count , :id ) == 0
264+ end
249265 end
250266
251267 describe "issue_event/1" do
You can’t perform that action at this time.
0 commit comments