Skip to content

Commit

Permalink
Use proper key.
Browse files Browse the repository at this point in the history
  • Loading branch information
asummers committed Nov 26, 2017
1 parent cddd504 commit a5e50f5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ defmodule CodeCorpsWeb.GithubEventControllerTest do
test "responds with 200 for a supported event", %{conn: conn} do
path = conn |> github_events_path(:create)
payload = load_event_fixture("installation_created")
insert(:github_repo, id: payload["repository"]["id"])
insert(:github_repo, github_id: payload["repository"]["id"])
assert conn |> for_event("installation", "foo") |> post(path, payload) |> response(200)

assert Repo.get_by(GithubEvent, github_delivery_id: "foo")
Expand All @@ -102,7 +102,7 @@ defmodule CodeCorpsWeb.GithubEventControllerTest do
test "responds with 200 for an unsupported event", %{conn: conn} do
path = conn |> github_events_path(:create)
payload = load_event_fixture("pull_request_synchronize")
insert(:github_repo, id: payload["repository"]["id"])
insert(:github_repo, github_id: payload["repository"]["id"])
assert conn |> for_event("pull_request", "foo") |> post(path, payload) |> response(200)

assert Repo.get_by(GithubEvent, github_delivery_id: "foo")
Expand All @@ -112,7 +112,7 @@ defmodule CodeCorpsWeb.GithubEventControllerTest do
test "responds with 202 for a supported event but no project_id", %{conn: conn} do
path = conn |> github_events_path(:create)
payload = load_event_fixture("installation_created")
insert(:github_repo, id: payload["repository"]["id"], project: nil)
insert(:github_repo, github_id: payload["repository"]["id"], project: nil)
assert conn |> for_event("installation", "foo") |> post(path, payload) |> response(202)

refute Repo.get_by(GithubEvent, github_delivery_id: "foo")
Expand Down

0 comments on commit a5e50f5

Please sign in to comment.