groupdocs 0.2 → 0.2.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.
- data/lib/groupdocs.rb +1 -0
- data/lib/groupdocs/api.rb +0 -1
- data/lib/groupdocs/api/helpers.rb +3 -1
- data/lib/groupdocs/api/helpers/access_mode_helper.rb +32 -0
- data/lib/groupdocs/api/helpers/{access_helper.rb → credentials_helper.rb} +2 -23
- data/lib/groupdocs/api/helpers/path_helper.rb +28 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +1 -1
- data/lib/groupdocs/api/helpers/url_helper.rb +1 -1
- data/lib/groupdocs/api/request.rb +3 -3
- data/lib/groupdocs/datasource.rb +6 -6
- data/lib/groupdocs/document.rb +34 -34
- data/lib/groupdocs/document/annotation.rb +6 -6
- data/lib/groupdocs/document/annotation/reply.rb +5 -5
- data/lib/groupdocs/extensions.rb +1 -0
- data/lib/groupdocs/extensions/lookup.rb +52 -0
- data/lib/groupdocs/job.rb +13 -13
- data/lib/groupdocs/questionnaire.rb +14 -14
- data/lib/groupdocs/questionnaire/execution.rb +3 -3
- data/lib/groupdocs/questionnaire/page.rb +1 -1
- data/lib/groupdocs/questionnaire/question.rb +1 -1
- data/lib/groupdocs/storage.rb +1 -1
- data/lib/groupdocs/storage/file.rb +28 -25
- data/lib/groupdocs/storage/folder.rb +19 -27
- data/lib/groupdocs/storage/package.rb +1 -1
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/helpers/access_mode_helper_spec.rb +49 -0
- data/spec/groupdocs/api/helpers/{access_helper_spec.rb → credentials_helpers_spec.rb} +1 -42
- data/spec/groupdocs/api/helpers/path_helper_spec.rb +28 -0
- data/spec/groupdocs/document_spec.rb +1 -1
- data/spec/groupdocs/storage/file_spec.rb +23 -28
- data/spec/groupdocs/storage/folder_spec.rb +18 -18
- data/spec/support/shared_examples/api/helpers/access_mode_helper.rb +12 -0
- data/spec/support/shared_examples/{api/sugar → extensions}/lookup.rb +1 -1
- metadata +35 -26
- data/lib/groupdocs/api/sugar/lookup.rb +0 -57
@@ -2,8 +2,8 @@ module GroupDocs
|
|
2
2
|
module Storage
|
3
3
|
class Folder < GroupDocs::Api::Entity
|
4
4
|
|
5
|
-
extend
|
6
|
-
include
|
5
|
+
extend Extensions::Lookup
|
6
|
+
include Api::Helpers::AccessMode
|
7
7
|
|
8
8
|
#
|
9
9
|
# Creates folder on server.
|
@@ -14,18 +14,16 @@ module GroupDocs
|
|
14
14
|
# @option access [String] :private_key
|
15
15
|
# @return [GroupDocs::Storage::Folder] Created folder
|
16
16
|
#
|
17
|
-
# @raise [ArgumentError] If path does not start with /
|
18
|
-
#
|
19
17
|
def self.create!(path, access = {})
|
20
|
-
|
18
|
+
Api::Helpers::Path.verify_starts_with_root(path)
|
21
19
|
|
22
|
-
json =
|
20
|
+
json = Api::Request.new do |request|
|
23
21
|
request[:access] = access
|
24
22
|
request[:method] = :POST
|
25
23
|
request[:path] = "/storage/{{client_id}}/paths#{path}"
|
26
24
|
end.execute!
|
27
25
|
|
28
|
-
|
26
|
+
Storage::Folder.new(json)
|
29
27
|
end
|
30
28
|
|
31
29
|
#
|
@@ -64,10 +62,8 @@ module GroupDocs
|
|
64
62
|
# @option access [String] :private_key
|
65
63
|
# @return [Array<GroupDocs::Storage::Folder, GroupDocs::Storage::File>]
|
66
64
|
#
|
67
|
-
# @raise [ArgumentError] If path does not start with /
|
68
|
-
#
|
69
65
|
def self.list!(path = '/', options = {}, access = {})
|
70
|
-
|
66
|
+
Api::Helpers::Path.verify_starts_with_root(path)
|
71
67
|
new(path: path).list!(options, access)
|
72
68
|
end
|
73
69
|
|
@@ -132,12 +128,10 @@ module GroupDocs
|
|
132
128
|
# @option access [String] :private_key
|
133
129
|
# @return [String] Moved to folder path
|
134
130
|
#
|
135
|
-
# @raise [ArgumentError] If path does not start with /
|
136
|
-
#
|
137
131
|
def move!(path, access = {})
|
138
|
-
|
132
|
+
Api::Helpers::Path.verify_starts_with_root(path)
|
139
133
|
|
140
|
-
|
134
|
+
Api::Request.new do |request|
|
141
135
|
request[:access] = access
|
142
136
|
request[:method] = :PUT
|
143
137
|
request[:headers] = { :'Groupdocs-Move' => name }
|
@@ -169,12 +163,10 @@ module GroupDocs
|
|
169
163
|
# @option access [String] :private_key
|
170
164
|
# @return [String] Copied to folder path
|
171
165
|
#
|
172
|
-
# @raise [ArgumentError] If path does not start with /
|
173
|
-
#
|
174
166
|
def copy!(path, access = {})
|
175
|
-
|
167
|
+
Api::Helpers::Path.verify_starts_with_root(path)
|
176
168
|
|
177
|
-
|
169
|
+
Api::Request.new do |request|
|
178
170
|
request[:access] = access
|
179
171
|
request[:method] = :PUT
|
180
172
|
request[:headers] = { :'Groupdocs-Copy' => name }
|
@@ -200,7 +192,7 @@ module GroupDocs
|
|
200
192
|
def list!(options = {}, access = {})
|
201
193
|
options[:order_by].capitalize! if options[:order_by]
|
202
194
|
|
203
|
-
api =
|
195
|
+
api = Api::Request.new do |request|
|
204
196
|
request[:access] = access
|
205
197
|
request[:method] = :GET
|
206
198
|
request[:path] = "/storage/{{client_id}}/folders#{path}/#{name}"
|
@@ -211,9 +203,9 @@ module GroupDocs
|
|
211
203
|
json[:entities].map do |entity|
|
212
204
|
entity.merge!(path: path)
|
213
205
|
if entity[:dir]
|
214
|
-
|
206
|
+
Storage::Folder.new(entity)
|
215
207
|
else
|
216
|
-
|
208
|
+
Storage::File.new(entity)
|
217
209
|
end
|
218
210
|
end
|
219
211
|
end
|
@@ -237,7 +229,7 @@ module GroupDocs
|
|
237
229
|
# @option access [String] :private_key
|
238
230
|
#
|
239
231
|
def delete!(access = {})
|
240
|
-
|
232
|
+
Api::Request.new do |request|
|
241
233
|
request[:access] = access
|
242
234
|
request[:method] = :DELETE
|
243
235
|
request[:path] = "/storage/{{client_id}}/folders/#{name}"
|
@@ -253,14 +245,14 @@ module GroupDocs
|
|
253
245
|
# @return [Array<GroupDocs::User>]
|
254
246
|
#
|
255
247
|
def sharers!(access = {})
|
256
|
-
json =
|
248
|
+
json = Api::Request.new do |request|
|
257
249
|
request[:access] = access
|
258
250
|
request[:method] = :GET
|
259
251
|
request[:path] = "/doc/{{client_id}}/folders/#{id}/sharers"
|
260
252
|
end.execute!
|
261
253
|
|
262
254
|
json[:shared_users].map do |user|
|
263
|
-
|
255
|
+
User.new(user)
|
264
256
|
end
|
265
257
|
end
|
266
258
|
|
@@ -279,7 +271,7 @@ module GroupDocs
|
|
279
271
|
if emails.nil? || emails.empty?
|
280
272
|
sharers_clear!(access)
|
281
273
|
else
|
282
|
-
json =
|
274
|
+
json = Api::Request.new do |request|
|
283
275
|
request[:access] = access
|
284
276
|
request[:method] = :PUT
|
285
277
|
request[:path] = "/doc/{{client_id}}/folders/#{id}/sharers"
|
@@ -287,7 +279,7 @@ module GroupDocs
|
|
287
279
|
end.execute!
|
288
280
|
|
289
281
|
json[:shared_users].map do |user|
|
290
|
-
|
282
|
+
User.new(user)
|
291
283
|
end
|
292
284
|
end
|
293
285
|
end
|
@@ -301,7 +293,7 @@ module GroupDocs
|
|
301
293
|
# @return nil
|
302
294
|
#
|
303
295
|
def sharers_clear!(access = {})
|
304
|
-
|
296
|
+
Api::Request.new do |request|
|
305
297
|
request[:access] = access
|
306
298
|
request[:method] = :DELETE
|
307
299
|
request[:path] = "/doc/{{client_id}}/folders/#{id}/sharers"
|
@@ -27,7 +27,7 @@ module GroupDocs
|
|
27
27
|
# @return [String] URL of package for downloading
|
28
28
|
#
|
29
29
|
def create!(access = {})
|
30
|
-
json =
|
30
|
+
json = Api::Request.new do |request|
|
31
31
|
request[:access] = access
|
32
32
|
request[:method] = :POST
|
33
33
|
request[:path] = "/storage/{{client_id}}/packages/#{name}.zip"
|
data/lib/groupdocs/version.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GroupDocs::Api::Helpers::AccessMode do
|
4
|
+
|
5
|
+
subject do
|
6
|
+
GroupDocs::Storage::Folder.new
|
7
|
+
end
|
8
|
+
|
9
|
+
describe 'MODES' do
|
10
|
+
it 'contains hash of access modes' do
|
11
|
+
described_class::MODES.should == {
|
12
|
+
private: 0,
|
13
|
+
restricted: 1,
|
14
|
+
public: 2,
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#parse_access_mode' do
|
20
|
+
it 'raise error if mode is unknown' do
|
21
|
+
-> { subject.send(:parse_access_mode, 3) }.should raise_error(ArgumentError)
|
22
|
+
-> { subject.send(:parse_access_mode, :unknown) }.should raise_error(ArgumentError)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns :private if passed mode is 0' do
|
26
|
+
subject.send(:parse_access_mode, 0).should == :private
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns :restricted if passed mode is 1' do
|
30
|
+
subject.send(:parse_access_mode, 1).should == :restricted
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'returns :public if passed mode is 2' do
|
34
|
+
subject.send(:parse_access_mode, 2).should == :public
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'returns 0 if passed mode is :private' do
|
38
|
+
subject.send(:parse_access_mode, :private).should == 0
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'returns 1 if passed mode is :restricted' do
|
42
|
+
subject.send(:parse_access_mode, :restricted).should == 1
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'returns 2 if passed mode is :public' do
|
46
|
+
subject.send(:parse_access_mode, :public).should == 2
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -1,21 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe GroupDocs::Api::Helpers::
|
3
|
+
describe GroupDocs::Api::Helpers::Credentials do
|
4
4
|
|
5
5
|
subject do
|
6
6
|
GroupDocs::Api::Request.new(method: :GET)
|
7
7
|
end
|
8
8
|
|
9
|
-
describe 'MODES' do
|
10
|
-
it 'contains hash of access modes' do
|
11
|
-
described_class::MODES.should == {
|
12
|
-
private: 0,
|
13
|
-
restricted: 1,
|
14
|
-
public: 2,
|
15
|
-
}
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
9
|
describe '#client_id' do
|
20
10
|
it 'returns passed to method client ID' do
|
21
11
|
subject.options[:access] = { client_id: 'method_client_id' }
|
@@ -55,35 +45,4 @@ describe GroupDocs::Api::Helpers::Access do
|
|
55
45
|
-> { subject.send(:private_key) }.should raise_error(GroupDocs::NoPrivateKeyError)
|
56
46
|
end
|
57
47
|
end
|
58
|
-
|
59
|
-
describe '#parse_access_mode' do
|
60
|
-
it 'raise error if mode is unknown' do
|
61
|
-
-> { subject.send(:parse_access_mode, 3) }.should raise_error(ArgumentError)
|
62
|
-
-> { subject.send(:parse_access_mode, :unknown) }.should raise_error(ArgumentError)
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'returns :private if passed mode is 0' do
|
66
|
-
subject.send(:parse_access_mode, 0).should == :private
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'returns :restricted if passed mode is 1' do
|
70
|
-
subject.send(:parse_access_mode, 1).should == :restricted
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'returns :public if passed mode is 2' do
|
74
|
-
subject.send(:parse_access_mode, 2).should == :public
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'returns 0 if passed mode is :private' do
|
78
|
-
subject.send(:parse_access_mode, :private).should == 0
|
79
|
-
end
|
80
|
-
|
81
|
-
it 'returns 1 if passed mode is :restricted' do
|
82
|
-
subject.send(:parse_access_mode, :restricted).should == 1
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'returns 2 if passed mode is :public' do
|
86
|
-
subject.send(:parse_access_mode, :public).should == 2
|
87
|
-
end
|
88
|
-
end
|
89
48
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GroupDocs::Api::Helpers::Path do
|
4
|
+
|
5
|
+
describe '.verify_starts_with_root' do
|
6
|
+
it 'does not raise error if path starts with /' do
|
7
|
+
-> { described_class.verify_starts_with_root('/Test') }.should_not raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'raises error if path does not start with /' do
|
11
|
+
-> { described_class.verify_starts_with_root('Test') }.should raise_error(ArgumentError)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.append_file_name' do
|
16
|
+
it 'does not change path if filename is present' do
|
17
|
+
path = '/upload_path/test.pdf'
|
18
|
+
described_class.append_file_name(path, __FILE__)
|
19
|
+
path.should == '/upload_path/test.pdf'
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'appends filename to path if it is not passed' do
|
23
|
+
path = '/upload_path'
|
24
|
+
described_class.append_file_name(path, __FILE__)
|
25
|
+
path.should == "/upload_path/#{File.basename(__FILE__)}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -3,7 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe GroupDocs::Storage::File do
|
4
4
|
|
5
5
|
it_behaves_like GroupDocs::Api::Entity
|
6
|
-
include_examples GroupDocs::
|
6
|
+
include_examples GroupDocs::Extensions::Lookup
|
7
|
+
include_examples GroupDocs::Api::Helpers::AccessMode
|
7
8
|
|
8
9
|
describe 'DOCUMENT_TYPES' do
|
9
10
|
it 'contains hash of document types' do
|
@@ -30,14 +31,14 @@ describe GroupDocs::Storage::File do
|
|
30
31
|
end.should_not raise_error(ArgumentError)
|
31
32
|
end
|
32
33
|
|
33
|
-
it '
|
34
|
-
|
34
|
+
it 'checks that upload path starts with /' do
|
35
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('/upload_path')
|
36
|
+
described_class.upload!(__FILE__, '/upload_path')
|
35
37
|
end
|
36
38
|
|
37
39
|
it 'appends filename to upload path if it is not passed' do
|
38
|
-
|
39
|
-
|
40
|
-
described_class.upload!(__FILE__, upload_path)
|
40
|
+
GroupDocs::Api::Helpers::Path.should_receive(:append_file_name).with('/upload_path', __FILE__)
|
41
|
+
described_class.upload!(__FILE__, '/upload_path')
|
41
42
|
end
|
42
43
|
|
43
44
|
it 'returns GroupDocs::Storage::File object' do
|
@@ -69,8 +70,6 @@ describe GroupDocs::Storage::File do
|
|
69
70
|
it { should respond_to(:type=) }
|
70
71
|
it { should respond_to(:file_type) }
|
71
72
|
it { should respond_to(:file_type=) }
|
72
|
-
it { should respond_to(:access) }
|
73
|
-
it { should respond_to(:access=) }
|
74
73
|
it { should respond_to(:path) }
|
75
74
|
it { should respond_to(:path=) }
|
76
75
|
|
@@ -153,8 +152,14 @@ describe GroupDocs::Storage::File do
|
|
153
152
|
end.should_not raise_error(ArgumentError)
|
154
153
|
end
|
155
154
|
|
156
|
-
it '
|
157
|
-
|
155
|
+
it 'checks that path starts with /' do
|
156
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('/resume.pdf')
|
157
|
+
subject.move!('/resume.pdf')
|
158
|
+
end
|
159
|
+
|
160
|
+
it 'appends filename to move to path if it is not passed' do
|
161
|
+
GroupDocs::Api::Helpers::Path.should_receive(:append_file_name).with('/Folder', subject.name)
|
162
|
+
subject.move!('/Folder')
|
158
163
|
end
|
159
164
|
|
160
165
|
it 'sends "Groupdocs-Move" header' do
|
@@ -166,14 +171,6 @@ describe GroupDocs::Storage::File do
|
|
166
171
|
it 'returns moved to file' do
|
167
172
|
subject.move!('/resume2.pdf').should be_a(GroupDocs::Storage::File)
|
168
173
|
end
|
169
|
-
|
170
|
-
it 'appends filename to move to path if it is not passed' do
|
171
|
-
path = '/Folder'
|
172
|
-
name = File.basename(__FILE__)
|
173
|
-
subject.stub(name: name)
|
174
|
-
path.should_receive(:<<).with("/#{name}")
|
175
|
-
subject.move!(path)
|
176
|
-
end
|
177
174
|
end
|
178
175
|
|
179
176
|
describe '#rename!' do
|
@@ -204,8 +201,14 @@ describe GroupDocs::Storage::File do
|
|
204
201
|
end.should_not raise_error(ArgumentError)
|
205
202
|
end
|
206
203
|
|
207
|
-
it '
|
208
|
-
|
204
|
+
it 'checks that path starts with /' do
|
205
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('resume.pdf')
|
206
|
+
subject.copy!('resume.pdf')
|
207
|
+
end
|
208
|
+
|
209
|
+
it 'appends filename to move to path if it is not passed' do
|
210
|
+
GroupDocs::Api::Helpers::Path.should_receive(:append_file_name).with('/Folder', subject.name)
|
211
|
+
subject.copy!('/Folder')
|
209
212
|
end
|
210
213
|
|
211
214
|
it 'sends "Groupdocs-Copy" header' do
|
@@ -217,14 +220,6 @@ describe GroupDocs::Storage::File do
|
|
217
220
|
it 'returns copied to file' do
|
218
221
|
subject.copy!('/resume2.pdf').should be_a(GroupDocs::Storage::File)
|
219
222
|
end
|
220
|
-
|
221
|
-
it 'appends filename to copy to path if it is not passed' do
|
222
|
-
path = '/Folder'
|
223
|
-
name = File.basename(__FILE__)
|
224
|
-
subject.stub(name: name)
|
225
|
-
path.should_receive(:<<).with("/#{name}")
|
226
|
-
subject.copy!(path)
|
227
|
-
end
|
228
223
|
end
|
229
224
|
|
230
225
|
describe '#compress!' do
|
@@ -3,7 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe GroupDocs::Storage::Folder do
|
4
4
|
|
5
5
|
it_behaves_like GroupDocs::Api::Entity
|
6
|
-
include_examples GroupDocs::
|
6
|
+
include_examples GroupDocs::Extensions::Lookup
|
7
|
+
include_examples GroupDocs::Api::Helpers::AccessMode
|
7
8
|
|
8
9
|
describe '.create!' do
|
9
10
|
before(:each) do
|
@@ -16,8 +17,9 @@ describe GroupDocs::Storage::Folder do
|
|
16
17
|
end.should_not raise_error(ArgumentError)
|
17
18
|
end
|
18
19
|
|
19
|
-
it '
|
20
|
-
|
20
|
+
it 'checks that path starts with /' do
|
21
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('Test')
|
22
|
+
described_class.create!('Test')
|
21
23
|
end
|
22
24
|
|
23
25
|
it 'returns GroupDocs::Storage::Folder object' do
|
@@ -74,8 +76,6 @@ describe GroupDocs::Storage::Folder do
|
|
74
76
|
it { should respond_to(:version=) }
|
75
77
|
it { should respond_to(:type) }
|
76
78
|
it { should respond_to(:type=) }
|
77
|
-
it { should respond_to(:access) }
|
78
|
-
it { should respond_to(:access=) }
|
79
79
|
|
80
80
|
describe '#created_on' do
|
81
81
|
it 'returns converted to Time object Unix timestamp' do
|
@@ -91,23 +91,20 @@ describe GroupDocs::Storage::Folder do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
describe '#
|
95
|
-
|
96
|
-
|
97
|
-
subject.access = 0
|
98
|
-
subject.access.should == :private
|
94
|
+
describe '#move!' do
|
95
|
+
before(:each) do
|
96
|
+
mock_api_server(load_json('folder_move'))
|
99
97
|
end
|
100
|
-
end
|
101
98
|
|
102
|
-
describe '#move!' do
|
103
99
|
it 'accepts access credentials hash' do
|
104
100
|
lambda do
|
105
101
|
subject.move!('/Test', client_id: 'client_id', private_key: 'private_key')
|
106
102
|
end.should_not raise_error(ArgumentError)
|
107
103
|
end
|
108
104
|
|
109
|
-
it '
|
110
|
-
|
105
|
+
it 'checks that path starts with /' do
|
106
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('Test1')
|
107
|
+
subject.move!('Test1')
|
111
108
|
end
|
112
109
|
|
113
110
|
it 'sends "Groupdocs-Move" header' do
|
@@ -117,7 +114,6 @@ describe GroupDocs::Storage::Folder do
|
|
117
114
|
end
|
118
115
|
|
119
116
|
it 'returns moved to folder path' do
|
120
|
-
mock_api_server(load_json('folder_move'))
|
121
117
|
moved = subject.move!('/Test2')
|
122
118
|
moved.should be_a(String)
|
123
119
|
moved.should == '/Test2'
|
@@ -145,14 +141,19 @@ describe GroupDocs::Storage::Folder do
|
|
145
141
|
end
|
146
142
|
|
147
143
|
describe '#copy!' do
|
144
|
+
before(:each) do
|
145
|
+
mock_api_server(load_json('folder_move'))
|
146
|
+
end
|
147
|
+
|
148
148
|
it 'accepts access credentials hash' do
|
149
149
|
lambda do
|
150
150
|
subject.copy!('/Test2', client_id: 'client_id', private_key: 'private_key')
|
151
151
|
end.should_not raise_error(ArgumentError)
|
152
152
|
end
|
153
153
|
|
154
|
-
it '
|
155
|
-
|
154
|
+
it 'checks that path starts with /' do
|
155
|
+
GroupDocs::Api::Helpers::Path.should_receive(:verify_starts_with_root).with('Test2')
|
156
|
+
subject.copy!('Test2')
|
156
157
|
end
|
157
158
|
|
158
159
|
it 'sends "Groupdocs-Copy" header' do
|
@@ -162,7 +163,6 @@ describe GroupDocs::Storage::Folder do
|
|
162
163
|
end
|
163
164
|
|
164
165
|
it 'returns moved to folder path' do
|
165
|
-
mock_api_server(load_json('folder_move'))
|
166
166
|
moved = subject.copy!('/Test2')
|
167
167
|
moved.should be_a(String)
|
168
168
|
moved.should == '/Test2'
|