   end
 
   test "SessionsController GET new" do
-    conn = create_conn(:get, sessions_path(Blog.Endpoint, :new))
+    conn = create_conn(:get, sessions_path(Endpoint, :new))
     should_be_unauthenticated!(conn)
     conn = request(conn)
 

  end

  test "PostsController GET edit" do
    conn = create_conn(:get, posts_path(Blog.Endpoint, :edit, create_post.id))
    should_be_authenticated!(conn)

    conn = sign_in(conn, create_user)

  alias Blog.Post
  alias Blog.User
  alias Blog.Repo
  alias Blog.Endpoint

  @doc """
  Makes sure that conn is redirected with a flash if there's no user logged in.
  """
  def should_be_authenticated!(%Plug.Conn{} = conn) do
    conn = request(conn)
    assert get_flash(conn, :alert) == "You must be authenticated to proceed"
    assert conn.status == 302
  end

  @doc """
  Makes sure that conn is redirected with a flash if the user is already logged in.
  """
  def should_be_unauthenticated!(%Plug.Conn{} = conn, user \\ create_user) do
    conn = sign_in(conn, user)
    conn = request(conn)
