   test "shows the right card", %{conn: conn} do
     site = create(:site)
     card = create(:card, site: site, title: "test card")
-    url = site.protocol <> "://" <> site.domain <> "/" <> card.path
+    url = make_url(site.protocol, site.domain, card.path)
     conn = get(conn, site_card_path(Endpoint, :show, site.id, url: url))
     resp = json_response(conn, 200)
     assert resp["title"] == card.title

  test "returns 404 when card does not exist", %{conn: conn} do
    site = create(:site)
    create(:card, site: site)
    url = site.protocol <> "://" <> site.domain <> "/" <> "doesnotexist"
    conn = get(conn, site_card_path(Endpoint, :show, site.id, url: url))
    assert json_response(conn, 404) == nil
  end

end

    site = create(:site)
    site2 = create(:site)
    card = create(:card, site: site)
    url = make_url(site.protocol, site.domain, card.path)
    conn = get(conn, site_card_path(Endpoint, :show, site2.id, url: url))
    assert json_response(conn, 404) == nil
  end
