     # Adds a reviewer comment.
     pr = Enum.find(prs(), &(match?(%{number: ^pr_num}, &1)))
     update_mock([:comments, pr_num], &([body | &1]))
-    WebhookController.do_webhook(
-      %{
+    WebhookController.do_webhook(%{
 	  body_params: %{
 	    "sender" => author,
     	    "repository" => %{ "id" => @def_repo},

  Assumes a single GitHub instance with a single repository and single user.

  Does everything through webhook notifications. Does not use
  Database.Repo.insert directly! (Exception: adding a reviewer, normally
  through Bors' web UI.)
  """

  alias BorsNG.GitHub.ServerMock
  alias BorsNG.GitHub.FriendlyMock
  alias BorsNG.GitHub.Pr
  alias BorsNG.WebhookController

  # Defaults
  @def_user %{"id" => 7,


  def add_reviewer(repo \\ @def_repo, user \\ @def_user) do
    # Could try to replace this with calls to the phoenix server
    # to avoid the direct call to BorsNG.ProjectController
    project = Repo.get_by!(Database.Project, %{repo_xref: repo})
    BorsNG.ProjectController.add_reviewer(nil, :rw, project, %{"reviewer" => user})
  end
