Remove CouchRest.move, CouchRest::Database#move and #move_doc, because these methods are no longer supported by CouchDB
Ref: http://n2.nabble.com/Removing-MOVE-td2490780.html#a2490780
This commit is contained in:
parent
76ef427862
commit
4d8314124b
4 changed files with 0 additions and 113 deletions
|
@ -554,50 +554,6 @@ describe CouchRest::Database do
|
|||
end
|
||||
end
|
||||
|
||||
describe "MOVE existing document" do
|
||||
before :each do
|
||||
@r = @db.save_doc({'artist' => 'Zappa', 'title' => 'Muffin Man'})
|
||||
@docid = 'tracks/zappa/muffin-man'
|
||||
@doc = @db.get(@r['id'])
|
||||
end
|
||||
describe "to a new location" do
|
||||
it "should work" do
|
||||
@db.move_doc @doc, @docid
|
||||
newdoc = @db.get(@docid)
|
||||
newdoc['artist'].should == 'Zappa'
|
||||
lambda {@db.get(@r['id'])}.should raise_error(RestClient::ResourceNotFound)
|
||||
end
|
||||
it "should fail without an _id or _rev" do
|
||||
lambda{@db.move({"not"=>"a real doc"})}.should raise_error(ArgumentError)
|
||||
lambda{@db.move({"_id"=>"not a real doc"})}.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
describe "to an existing location" do
|
||||
before :each do
|
||||
@db.save_doc({'_id' => @docid, 'will-exist' => 'here'})
|
||||
end
|
||||
it "should fail without a rev" do
|
||||
@doc.delete("_rev")
|
||||
lambda{@db.move_doc @doc, @docid}.should raise_error(ArgumentError)
|
||||
lambda{@db.get(@r['id'])}.should_not raise_error
|
||||
end
|
||||
it "should succeed with a rev" do
|
||||
@to_be_overwritten = @db.get(@docid)
|
||||
@db.move_doc @doc, "#{@docid}?rev=#{@to_be_overwritten['_rev']}"
|
||||
newdoc = @db.get(@docid)
|
||||
newdoc['artist'].should == 'Zappa'
|
||||
lambda {@db.get(@r['id'])}.should raise_error(RestClient::ResourceNotFound)
|
||||
end
|
||||
it "should succeed given the doc to overwrite" do
|
||||
@to_be_overwritten = @db.get(@docid)
|
||||
@db.move_doc @doc, @to_be_overwritten
|
||||
newdoc = @db.get(@docid)
|
||||
newdoc['artist'].should == 'Zappa'
|
||||
lambda {@db.get(@r['id'])}.should raise_error(RestClient::ResourceNotFound)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
it "should list documents" do
|
||||
5.times do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue