Skip to content

Commit 5cae90e

Browse files
committed
Remove unused Sync.Comment module. Cleaned up tests and events for it.
1 parent a895d95 commit 5cae90e

File tree

3 files changed

+16
-112
lines changed

3 files changed

+16
-112
lines changed

lib/code_corps/github/sync/comment/comment.ex

Lines changed: 0 additions & 39 deletions
This file was deleted.

test/lib/code_corps/github/sync/comment/comment_test.exs

Lines changed: 0 additions & 73 deletions
This file was deleted.

test/lib/code_corps/github/sync/sync_test.exs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)