Skip to content

Commit

Permalink
Test for error when the task_list isnt found
Browse files Browse the repository at this point in the history
  • Loading branch information
zacck committed Mar 2, 2018
1 parent e8027f9 commit f821630
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/lib/code_corps/github/sync/sync_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,21 @@ 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

describe "pull_request_event/1 " 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
Expand Down

0 comments on commit f821630

Please sign in to comment.