anchor.diff:          save_doc(Db, {[{<<"_id">>, <<"doc5">>}]})
       ]],
       Rev = lists:nth(3, Revs),
  -    {ok, Rev1} = save_doc(Db, {[{<<"_id">>, <<"doc3">>}, {<<"_rev">>, Rev}]}),
  +    couch_db:ensure_full_commit(Db),
  +    {ok, Db1} = couch_db:reopen(Db),
  +
  +    Doc = couch_db:open_doc(Db1, <<"doc3">>),
  +
  +    {ok, Rev1} = save_doc(Db1, {[{<<"_id">>, <<"doc3">>}, {<<"_rev">>, Rev}]}),
       Revs1 = Revs ++ [Rev1],
       Revs2 = Revs1 ++ [R || {ok, R} <- [
  -        save_doc(Db, {[{<<"_id">>, <<"doc6">>}]}),
  -        save_doc(Db, {[{<<"_id">>, <<"_design/foo">>}]}),
  -        save_doc(Db, {[{<<"_id">>, <<"doc7">>}]}),
  -        save_doc(Db, {[{<<"_id">>, <<"doc8">>}]})
  +        save_doc(Db1, {[{<<"_id">>, <<"doc6">>}]}),
  +        save_doc(Db1, {[{<<"_id">>, <<"_design/foo">>}]}),
  +        save_doc(Db1, {[{<<"_id">>, <<"doc7">>}]}),
  +        save_doc(Db1, {[{<<"_id">>, <<"doc8">>}]})
       ]],
       {DbName, list_to_tuple(Revs2)}.
   
  
positive.code:             {ok, _} = save_doc(Db, {[{<<"_id">>, <<"doc12">>}]}),
              {ok, Rev3_3} = save_doc(Db, {[{<<"_id">>, <<"doc3">>},
                                            {<<"_rev">>, Rev3_2}]}),
              unpause(Consumer),
              pause(Consumer),
  
              NewRows = get_rows(Consumer),
              ?assertEqual(2, length(NewRows)),
  
negative.code:             clear_rows(Consumer),
              {ok, _Rev3_4} = save_doc(Db, {[{<<"_id">>, <<"doc3">>},
                                             {<<"_rev">>, Rev3_3}]}),
              ok = unpause(Consumer),
              timer:sleep(100),
              ok = pause(Consumer),
  
              FinalRows = get_rows(Consumer),
  
              ok = unpause(Consumer),
              stop_consumer(Consumer),
  
              ?assertMatch([#row{seq = 18, id = <<"doc3">>}], FinalRows)
  