anchor.diff:      view_cleanup(DbName),
       ?_assertEqual(0, count_index_files(DbName)).
   
  +
  +create_doc(DbName) ->
  +    {ok, Db} = couch_db:open(DbName, [?ADMIN_USER]),
  +    Doc666 = couch_doc:from_json_obj({[
  +        {<<"_id">>, <<"doc666">>},
  +        {<<"value">>, 999}
  +
  +    ]}),
  +    {ok, _} = couch_db:update_docs(Db, [Doc666]),
  +    couch_db:ensure_full_commit(Db),
  +    couch_db:close(Db).
  +
  +create_docs(DbName) ->
  +    {ok, Db} = couch_db:open(DbName, [?ADMIN_USER]),
  +    Doc1 = couch_doc:from_json_obj({[
  +        {<<"_id">>, <<"doc1">>},
  +        {<<"value">>, 1}
  +
  +    ]}),
  +    Doc2 = couch_doc:from_json_obj({[
  +        {<<"_id">>, <<"doc2">>},
  +        {<<"value">>, 2}
  +
  +    ]}),
  +    Doc3 = couch_doc:from_json_obj({[
  +        {<<"_id">>, <<"doc3">>},
  +        {<<"value">>, 3}
  +
  +    ]}),
  +    {ok, _} = couch_db:update_docs(Db, [Doc1, Doc2, Doc3]),
  +    couch_db:ensure_full_commit(Db),
  +    couch_db:close(Db).
   
   create_design_doc(DbName, DDName, ViewName) ->
       {ok, Db} = couch_db:open(DbName, [?ADMIN_USER]),
  
positive.code:     RootDir = couch_config:get("couchdb", "view_index_dir"),
      length(filelib:wildcard(RootDir ++ "/." ++
          binary_to_list(DbName) ++ "_design"++"/mrview/*")).
  
negative.code: db_url(DbName) ->
      Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
      Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
      "http://" ++ Addr ++ ":" ++ Port ++ "/" ++ ?b2l(DbName).
  
  query_view(DbName, DDoc, View) ->
      {ok, Code, _Headers, Body} = test_request:get(
          db_url(DbName) ++ "/_design/" ++ DDoc ++ "/_view/" ++ View),
      ?assertEqual(200, Code),
      Body.
  
  view_cleanup(DbName) ->
      {ok, Db} = couch_db:open(DbName, [?ADMIN_USER]),
  