   test "shows chosen resource", %{conn: conn} do
     badge = Repo.insert! valid_badge
 
-    conn = get_authenticated(conn, "/badges/coverage")
+    conn = get(conn, "/badges/coverage", token: valid_read_token)
 
     assert json_response(conn, 200)["data"] == %{
       "id" => badge.id,

    put_req_header(conn, "authorization", header_content)
  end

  defp get_authenticated(conn, path) do
    read_auth_token = Application.get_env(:badging, :read_auth_token)
    get(conn, path, token: read_auth_token)
  end
end

    Repo.insert! valid_badge

    assert_error_sent 404, fn ->
      get(conn, "/badges/coverage.svg", token: valid_read_token)
    end
  end

  test "renders page not found when id is nonexistent", %{conn: conn} do
    assert_error_sent 404, fn ->
      get(conn, "/badges/dont_exist.svg", token: valid_read_token)
    end
  end

