public void testPushApp() throws IOException {
    File tmpDir = generateCouchApp();
    String url = couchAppUtil.pushCouchApp(tmpDir, "http://localhost:5984/testdb");

    String expected = "http://localhost:5984/testdb/_design/" + tmpDir.getName() + "/index.html";

    assertEquals(expected, url);
  }
  public void testCloneCouchApp() throws IOException {
    File couchAppDir = generateCouchApp();
    String couchAppUrl = "http://localhost:5984/clone";
    couchAppUrl = couchAppUtil.pushCouchApp(couchAppDir, couchAppUrl);
    couchAppUrl = couchAppUrl.replace("/index.html", "");

    File tmpDir = getTmpFolder();
    URL url = new URL(couchAppUrl);
    couchAppUtil.cloneCouchApp(tmpDir, url);

    assertTrue("missing .couchapprc file", new File(tmpDir, ".couchapprc").exists());
    assertTrue("missing couchapp.json file", new File(tmpDir, "couchapp.json").exists());
    assertTrue("missing _attachments directory", new File(tmpDir, "_attachments").exists());
  }