From f82163054a190149a9f35a762c3f273dd8d71db1 Mon Sep 17 00:00:00 2001 From: Zacck Osiemo Date: Fri, 2 Mar 2018 11:53:50 +0200 Subject: [PATCH] Test for error when the task_list isnt found --- test/lib/code_corps/github/sync/sync_test.exs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/lib/code_corps/github/sync/sync_test.exs b/test/lib/code_corps/github/sync/sync_test.exs index 87681ff4b..c8e1dff25 100644 --- a/test/lib/code_corps/github/sync/sync_test.exs +++ b/test/lib/code_corps/github/sync/sync_test.exs @@ -71,6 +71,13 @@ defmodule CodeCorps.GitHub.SyncTest do {:error, :validating_github_pull_request, _changeset} = Sync.pull_request_event(corrupt_pull_request) end + test "fails with validation error if task_list isn't found " <> @event do + payload = load_event_fixture(@event) + project = insert(:project) + insert(:github_repo, github_id: payload["repository"]["id"], project: project) + {:error, :validating_task, _changeset} = Sync.pull_request_event(payload) + end + end) end @@ -78,11 +85,7 @@ defmodule CodeCorps.GitHub.SyncTest do @payload load_event_fixture("pull_request_opened") - test "fails with validation error if task_list isn't found" do - project = insert(:project) - insert(:github_repo, github_id: @payload["repository"]["id"], project: project) - {:error, :validating_task, _changeset} = Sync.pull_request_event(@payload) - end + end describe "installation_repositories_event/1 added" do