dropbox-api 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,10 @@ module Dropbox
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def copy_from_copy_ref(copy_ref, to, options = {})
|
28
|
-
raw.copy({
|
28
|
+
raw.copy({
|
29
|
+
:from_copy_ref => copy_ref,
|
30
|
+
:to_path => to
|
31
|
+
}.merge(options))
|
29
32
|
end
|
30
33
|
|
31
34
|
end
|
@@ -23,6 +23,7 @@ module Dropbox
|
|
23
23
|
def request(endpoint, method, action, data = {})
|
24
24
|
action.sub! ':root', data.delete(:root) if action.match ':root'
|
25
25
|
action.sub! ':path', Dropbox::API::Util.escape(data.delete(:path)) if action.match ':path'
|
26
|
+
action = Dropbox::API::Util.remove_double_slashes(action)
|
26
27
|
connection.send(method, endpoint, action, data)
|
27
28
|
end
|
28
29
|
|
data/lib/dropbox-api/version.rb
CHANGED
@@ -116,12 +116,24 @@ describe Dropbox::API::Client do
|
|
116
116
|
|
117
117
|
describe "#search" do
|
118
118
|
|
119
|
-
|
119
|
+
let(:term) { "searchable-test-#{Dropbox::Spec.namespace}" }
|
120
|
+
|
121
|
+
before do
|
120
122
|
filename = "#{Dropbox::Spec.test_dir}/searchable-test-#{Dropbox::Spec.namespace}.txt"
|
121
123
|
@client.upload filename, "Some file"
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
end
|
125
|
+
|
126
|
+
after do
|
127
|
+
@response.size.should == 1
|
128
|
+
@response.first.class.should == Dropbox::API::File
|
129
|
+
end
|
130
|
+
|
131
|
+
it "finds a file" do
|
132
|
+
@response = @client.search term, :path => "#{Dropbox::Spec.test_dir}"
|
133
|
+
end
|
134
|
+
|
135
|
+
it "works if leading slash is present in path" do
|
136
|
+
@response = @client.search term, :path => "/#{Dropbox::Spec.test_dir}"
|
125
137
|
end
|
126
138
|
|
127
139
|
end
|