spec/unit/client_spec.rb in duracloud-client-0.2.0 vs spec/unit/client_spec.rb in duracloud-client-0.3.0
- old
+ new
@@ -128,13 +128,13 @@
specify {
stub = stub_request(:head, "https://example.com/durastore/foo/bar")
subject.get_content_properties("foo", "bar")
expect(stub).to have_been_requested
}
- it "escapes percent signs in the content id" do
- stub = stub_request(:head, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
- subject.get_content_properties("foo", "z/z/bar%2Fbaz")
+ it "escapes percent signs and spaces in the content id" do
+ stub = stub_request(:head, "https://example.com/durastore/foo/z/z/bar%252Fbaz%20spam%20eggs")
+ subject.get_content_properties("foo", "z/z/bar%2Fbaz spam eggs")
expect(stub).to have_been_requested
end
specify {
stub = stub_request(:head, "https://example.com/durastore/foo/bar")
.with(query: {storeID: 1})
@@ -238,11 +238,13 @@
}
end
describe "copy_content" do
specify {
- expect { subject.copy_content("foo", "bar", headers: {'x-dura-meta-copy-source'=>'space-id/content-id'}) }
- .to raise_error(NotImplementedError)
+ stub = stub_request(:put, "https://example.com/durastore/spam/eggs")
+ .with(headers: {'x-dura-meta-copy-source'=>'foo/bar'})
+ subject.copy_content("spam", "eggs", headers: {'x-dura-meta-copy-source'=>'foo/bar'})
+ expect(stub).to have_been_requested
}
end
describe "get_audit_log" do
specify {