groupdocs 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +41 -0
- data/examples/README.md +2 -3
- data/examples/api-samples/Gemfile +5 -0
- data/examples/api-samples/Gemfile.lock +27 -0
- data/examples/api-samples/README.md +12 -0
- data/examples/api-samples/app.rb +17 -0
- data/examples/api-samples/public/css/style.css +166 -0
- data/examples/api-samples/samples/sample1.rb +17 -0
- data/examples/api-samples/samples/sample10.rb +36 -0
- data/examples/api-samples/samples/sample2.rb +19 -0
- data/examples/api-samples/samples/sample3.rb +23 -0
- data/examples/api-samples/samples/sample4.rb +31 -0
- data/examples/api-samples/samples/sample5.rb +44 -0
- data/examples/api-samples/samples/sample6.rb +3 -0
- data/examples/api-samples/samples/sample7.rb +33 -0
- data/examples/api-samples/samples/sample8.rb +40 -0
- data/examples/api-samples/samples/sample9.rb +22 -0
- data/examples/api-samples/views/index.haml +23 -0
- data/examples/api-samples/views/layout.haml +7 -0
- data/examples/api-samples/views/sample1.haml +71 -0
- data/examples/api-samples/views/sample10.haml +69 -0
- data/examples/api-samples/views/sample2.haml +59 -0
- data/examples/api-samples/views/sample3.haml +62 -0
- data/examples/api-samples/views/sample4.haml +58 -0
- data/examples/api-samples/views/sample5.haml +62 -0
- data/examples/api-samples/views/sample6.haml +145 -0
- data/examples/api-samples/views/sample7.haml +59 -0
- data/examples/api-samples/views/sample8.haml +75 -0
- data/examples/api-samples/views/sample9.haml +61 -0
- data/examples/{annotations → viewer}/Gemfile +0 -0
- data/examples/viewer/app.rb +52 -0
- data/groupdocs.gemspec +5 -4
- data/lib/groupdocs/api.rb +1 -0
- data/lib/groupdocs/api/entity.rb +2 -0
- data/lib/groupdocs/api/helpers.rb +2 -0
- data/lib/groupdocs/api/helpers/accessor_helper.rb +30 -0
- data/lib/groupdocs/api/helpers/mime_helper.rb +21 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +3 -2
- data/lib/groupdocs/api/request.rb +1 -3
- data/lib/groupdocs/datasource.rb +1 -2
- data/lib/groupdocs/document.rb +133 -3
- data/lib/groupdocs/document/annotation.rb +14 -13
- data/lib/groupdocs/document/annotation/reply.rb +4 -8
- data/lib/groupdocs/document/annotation/reviewer.rb +2 -4
- data/lib/groupdocs/document/field.rb +10 -8
- data/lib/groupdocs/document/rectangle.rb +10 -18
- data/lib/groupdocs/job.rb +1 -1
- data/lib/groupdocs/questionnaire.rb +138 -44
- data/lib/groupdocs/questionnaire/collector.rb +262 -0
- data/lib/groupdocs/questionnaire/execution.rb +93 -10
- data/lib/groupdocs/questionnaire/question.rb +1 -2
- data/lib/groupdocs/signature.rb +16 -24
- data/lib/groupdocs/signature/contact.rb +2 -4
- data/lib/groupdocs/signature/envelope.rb +3 -6
- data/lib/groupdocs/signature/envelope/log.rb +2 -4
- data/lib/groupdocs/signature/field.rb +21 -42
- data/lib/groupdocs/signature/field/location.rb +18 -36
- data/lib/groupdocs/signature/form.rb +9 -18
- data/lib/groupdocs/signature/list.rb +1 -2
- data/lib/groupdocs/signature/recipient.rb +3 -6
- data/lib/groupdocs/signature/role.rb +4 -8
- data/lib/groupdocs/signature/shared/entity_fields.rb +12 -20
- data/lib/groupdocs/signature/template.rb +1 -2
- data/lib/groupdocs/storage/file.rb +3 -1
- data/lib/groupdocs/storage/folder.rb +7 -1
- data/lib/groupdocs/subscription.rb +6 -12
- data/lib/groupdocs/subscription/limit.rb +4 -8
- data/lib/groupdocs/user.rb +3 -6
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/helpers/accessor_helper_spec.rb +16 -0
- data/spec/groupdocs/api/helpers/mime_helper_spec.rb +16 -0
- data/spec/groupdocs/api/helpers/rest_helper_spec.rb +4 -0
- data/spec/groupdocs/api/request_spec.rb +3 -5
- data/spec/groupdocs/datasource/field_spec.rb +3 -6
- data/spec/groupdocs/datasource_spec.rb +8 -15
- data/spec/groupdocs/document/annotation/reply_spec.rb +13 -24
- data/spec/groupdocs/document/annotation/reviewer_spec.rb +5 -9
- data/spec/groupdocs/document/annotation_spec.rb +35 -40
- data/spec/groupdocs/document/change_spec.rb +6 -11
- data/spec/groupdocs/document/field_spec.rb +13 -13
- data/spec/groupdocs/document/metadata_spec.rb +5 -10
- data/spec/groupdocs/document/rectangle_spec.rb +6 -18
- data/spec/groupdocs/document/view_spec.rb +3 -6
- data/spec/groupdocs/document_spec.rb +123 -10
- data/spec/groupdocs/job_spec.rb +9 -18
- data/spec/groupdocs/questionnaire/collector_spec.rb +201 -0
- data/spec/groupdocs/questionnaire/execution_spec.rb +91 -23
- data/spec/groupdocs/questionnaire/page_spec.rb +3 -6
- data/spec/groupdocs/questionnaire/question/answer_spec.rb +2 -4
- data/spec/groupdocs/questionnaire/question_spec.rb +7 -14
- data/spec/groupdocs/questionnaire_spec.rb +117 -41
- data/spec/groupdocs/signature/contact_spec.rb +9 -17
- data/spec/groupdocs/signature/envelope/log_spec.rb +8 -16
- data/spec/groupdocs/signature/envelope_spec.rb +9 -17
- data/spec/groupdocs/signature/field/location_spec.rb +32 -65
- data/spec/groupdocs/signature/field_spec.rb +48 -95
- data/spec/groupdocs/signature/form_spec.rb +22 -43
- data/spec/groupdocs/signature/list_spec.rb +6 -11
- data/spec/groupdocs/signature/recipient_spec.rb +11 -22
- data/spec/groupdocs/signature/role_spec.rb +11 -21
- data/spec/groupdocs/signature/template_spec.rb +2 -4
- data/spec/groupdocs/signature_spec.rb +28 -54
- data/spec/groupdocs/storage/file_spec.rb +14 -26
- data/spec/groupdocs/storage/folder_spec.rb +16 -22
- data/spec/groupdocs/storage/package_spec.rb +2 -4
- data/spec/groupdocs/subscription/limit_spec.rb +8 -16
- data/spec/groupdocs/subscription_spec.rb +11 -22
- data/spec/groupdocs/user_spec.rb +21 -41
- data/spec/groupdocs_spec.rb +4 -8
- data/spec/spec_helper.rb +12 -0
- data/spec/support/files/signature.png +0 -0
- data/spec/support/json/annotation_list.json +6 -6
- data/spec/support/json/comparison_changes.json +8 -8
- data/spec/support/json/document_fields.json +8 -8
- data/spec/support/json/document_page_images_get.json +20 -0
- data/spec/support/json/questionnaire_collector.json +17 -0
- data/spec/support/json/questionnaire_collectors.json +38 -0
- data/spec/support/json/questionnaire_collectors_add.json +10 -0
- data/spec/support/json/questionnaire_create.json +3 -1
- data/spec/support/json/{questionnaire_execution_create.json → questionnaire_execution_add.json} +1 -1
- data/spec/support/json/questionnaire_get.json +3 -0
- data/spec/support/json/questionnaires_get.json +36 -18
- data/spec/support/json/sign_documents.json +16 -0
- data/spec/support/json/templates_get.json +21 -0
- data/spec/support/shared_examples/api/entity.rb +2 -0
- data/spec/support/shared_examples/api/helpers/access_mode_helper.rb +1 -2
- data/spec/support/shared_examples/api/helpers/status_helper.rb +1 -2
- data/spec/support/shared_examples/signature/shared/entity_fields.rb +22 -43
- metadata +82 -16
- data/examples/annotations/app.rb +0 -67
@@ -34,11 +34,9 @@ describe GroupDocs::Signature::Template do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
it { should
|
38
|
-
it { should respond_to(:templateExpireTime=) }
|
37
|
+
it { should have_accessor(:templateExpireTime) }
|
39
38
|
|
40
|
-
it { should
|
41
|
-
it { should have_alias(:template_expire_time=, :templateExpireTime=) }
|
39
|
+
it { should alias_accessor(:template_expire_time, :templateExpireTime) }
|
42
40
|
|
43
41
|
describe '#add_recipient!' do
|
44
42
|
let(:recipient) do
|
@@ -24,61 +24,35 @@ describe GroupDocs::Signature do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
it { should
|
28
|
-
it { should
|
29
|
-
it { should
|
30
|
-
it { should
|
31
|
-
it { should
|
32
|
-
it { should
|
33
|
-
it { should
|
34
|
-
it { should
|
35
|
-
it { should
|
36
|
-
it { should
|
37
|
-
it { should
|
38
|
-
it { should
|
39
|
-
it { should
|
40
|
-
it { should
|
41
|
-
it { should
|
42
|
-
it { should
|
43
|
-
it { should respond_to(:fullName) }
|
44
|
-
it { should respond_to(:fullName=) }
|
45
|
-
it { should respond_to(:textInitials) }
|
46
|
-
it { should respond_to(:textInitials=) }
|
47
|
-
it { should respond_to(:signatureImageFileId) }
|
48
|
-
it { should respond_to(:signatureImageFileId=) }
|
49
|
-
it { should respond_to(:initialsImageFileId) }
|
50
|
-
it { should respond_to(:initialsImageFileId=) }
|
51
|
-
it { should respond_to(:signatureImageUrl) }
|
52
|
-
it { should respond_to(:signatureImageUrl=) }
|
53
|
-
it { should respond_to(:initialsImageUrl) }
|
54
|
-
it { should respond_to(:initialsImageUrl=) }
|
55
|
-
it { should respond_to(:createdTimeStamp) }
|
56
|
-
it { should respond_to(:createdTimeStamp=) }
|
27
|
+
it { should have_accessor(:id) }
|
28
|
+
it { should have_accessor(:userGuid) }
|
29
|
+
it { should have_accessor(:recipientId) }
|
30
|
+
it { should have_accessor(:name) }
|
31
|
+
it { should have_accessor(:companyName) }
|
32
|
+
it { should have_accessor(:position) }
|
33
|
+
it { should have_accessor(:firstName) }
|
34
|
+
it { should have_accessor(:lastName) }
|
35
|
+
it { should have_accessor(:fullName) }
|
36
|
+
it { should have_accessor(:textInitials) }
|
37
|
+
it { should have_accessor(:signatureImageFileId) }
|
38
|
+
it { should have_accessor(:initialsImageFileId) }
|
39
|
+
it { should have_accessor(:signatureImageUrl) }
|
40
|
+
it { should have_accessor(:initialsImageUrl) }
|
41
|
+
it { should have_accessor(:createdTimeStamp) }
|
42
|
+
it { should have_accessor(:image_path) }
|
57
43
|
|
58
|
-
it { should
|
59
|
-
it { should
|
60
|
-
it { should
|
61
|
-
it { should
|
62
|
-
it { should
|
63
|
-
it { should
|
64
|
-
it { should
|
65
|
-
it { should
|
66
|
-
it { should
|
67
|
-
it { should
|
68
|
-
it { should
|
69
|
-
it { should
|
70
|
-
it { should have_alias(:text_initials, :textInitials) }
|
71
|
-
it { should have_alias(:text_initials=, :textInitials=) }
|
72
|
-
it { should have_alias(:signature_image_file_id, :signatureImageFileId) }
|
73
|
-
it { should have_alias(:signature_image_file_id=, :signatureImageFileId=) }
|
74
|
-
it { should have_alias(:initials_image_file_id, :initialsImageFileId) }
|
75
|
-
it { should have_alias(:initials_image_file_id=, :initialsImageFileId=) }
|
76
|
-
it { should have_alias(:signature_image_url, :signatureImageUrl) }
|
77
|
-
it { should have_alias(:signature_image_url=, :signatureImageUrl=) }
|
78
|
-
it { should have_alias(:initials_image_url, :initialsImageUrl) }
|
79
|
-
it { should have_alias(:initials_image_url=, :initialsImageUrl=) }
|
80
|
-
it { should have_alias(:created_time_stamp, :createdTimeStamp) }
|
81
|
-
it { should have_alias(:created_time_stamp=, :createdTimeStamp=) }
|
44
|
+
it { should alias_accessor(:user_guid, :userGuid) }
|
45
|
+
it { should alias_accessor(:recipient_id, :recipientId) }
|
46
|
+
it { should alias_accessor(:company_name, :companyName) }
|
47
|
+
it { should alias_accessor(:first_name, :firstName) }
|
48
|
+
it { should alias_accessor(:last_name, :lastName) }
|
49
|
+
it { should alias_accessor(:full_name, :fullName) }
|
50
|
+
it { should alias_accessor(:text_initials, :textInitials) }
|
51
|
+
it { should alias_accessor(:signature_image_file_id, :signatureImageFileId) }
|
52
|
+
it { should alias_accessor(:initials_image_file_id, :initialsImageFileId) }
|
53
|
+
it { should alias_accessor(:signature_image_url, :signatureImageUrl) }
|
54
|
+
it { should alias_accessor(:initials_image_url, :initialsImageUrl) }
|
55
|
+
it { should alias_accessor(:created_time_stamp, :createdTimeStamp) }
|
82
56
|
|
83
57
|
describe '#create!' do
|
84
58
|
before(:each) do
|
@@ -61,32 +61,20 @@ describe GroupDocs::Storage::File do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
it { should
|
65
|
-
it { should
|
66
|
-
it { should
|
67
|
-
it { should
|
68
|
-
it { should
|
69
|
-
it { should
|
70
|
-
it { should
|
71
|
-
it { should
|
72
|
-
it { should
|
73
|
-
it { should
|
74
|
-
it { should
|
75
|
-
it { should
|
76
|
-
it { should
|
77
|
-
it { should
|
78
|
-
it { should respond_to(:url) }
|
79
|
-
it { should respond_to(:url=) }
|
80
|
-
it { should respond_to(:name) }
|
81
|
-
it { should respond_to(:name=) }
|
82
|
-
it { should respond_to(:version) }
|
83
|
-
it { should respond_to(:version=) }
|
84
|
-
it { should respond_to(:type) }
|
85
|
-
it { should respond_to(:type=) }
|
86
|
-
it { should respond_to(:file_type) }
|
87
|
-
it { should respond_to(:file_type=) }
|
88
|
-
it { should respond_to(:path) }
|
89
|
-
it { should respond_to(:path=) }
|
64
|
+
it { should have_accessor(:id) }
|
65
|
+
it { should have_accessor(:guid) }
|
66
|
+
it { should have_accessor(:known) }
|
67
|
+
it { should have_accessor(:size) }
|
68
|
+
it { should have_accessor(:thumbnail) }
|
69
|
+
it { should have_accessor(:created_on) }
|
70
|
+
it { should have_accessor(:modified_on) }
|
71
|
+
it { should have_accessor(:url) }
|
72
|
+
it { should have_accessor(:name) }
|
73
|
+
it { should have_accessor(:version) }
|
74
|
+
it { should have_accessor(:type) }
|
75
|
+
it { should have_accessor(:file_type) }
|
76
|
+
it { should have_accessor(:path) }
|
77
|
+
it { should have_accessor(:local_path) }
|
90
78
|
|
91
79
|
it { should have_alias(:adj_name=, :name=) }
|
92
80
|
|
@@ -49,26 +49,16 @@ describe GroupDocs::Storage::Folder do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
it { should
|
53
|
-
it { should
|
54
|
-
it { should
|
55
|
-
it { should
|
56
|
-
it { should
|
57
|
-
it { should
|
58
|
-
it { should
|
59
|
-
it { should
|
60
|
-
it { should
|
61
|
-
it { should
|
62
|
-
it { should respond_to(:modified_on) }
|
63
|
-
it { should respond_to(:modified_on=) }
|
64
|
-
it { should respond_to(:url) }
|
65
|
-
it { should respond_to(:url=) }
|
66
|
-
it { should respond_to(:name) }
|
67
|
-
it { should respond_to(:name=) }
|
68
|
-
it { should respond_to(:version) }
|
69
|
-
it { should respond_to(:version=) }
|
70
|
-
it { should respond_to(:type) }
|
71
|
-
it { should respond_to(:type=) }
|
52
|
+
it { should have_accessor(:id) }
|
53
|
+
it { should have_accessor(:size) }
|
54
|
+
it { should have_accessor(:folder_count) }
|
55
|
+
it { should have_accessor(:file_count) }
|
56
|
+
it { should have_accessor(:created_on) }
|
57
|
+
it { should have_accessor(:modified_on) }
|
58
|
+
it { should have_accessor(:url) }
|
59
|
+
it { should have_accessor(:name) }
|
60
|
+
it { should have_accessor(:version) }
|
61
|
+
it { should have_accessor(:type) }
|
72
62
|
|
73
63
|
describe '#created_on' do
|
74
64
|
it 'returns converted to Time object Unix timestamp' do
|
@@ -102,8 +92,12 @@ describe GroupDocs::Storage::Folder do
|
|
102
92
|
|
103
93
|
it 'capitalizes :order_by option' do
|
104
94
|
options = { order_by: 'field' }
|
105
|
-
options[:order_by].
|
106
|
-
|
95
|
+
-> { subject.list!(options) }.should change { options[:order_by] }.to('Field')
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'camelizes :order_by option' do
|
99
|
+
options = { order_by: 'modified_on' }
|
100
|
+
-> { subject.list!(options) }.should change { options[:order_by] }.to('ModifiedOn')
|
107
101
|
end
|
108
102
|
|
109
103
|
it 'returns array' do
|
@@ -4,10 +4,8 @@ describe GroupDocs::Storage::Package do
|
|
4
4
|
|
5
5
|
it_behaves_like GroupDocs::Api::Entity
|
6
6
|
|
7
|
-
it { should
|
8
|
-
it { should
|
9
|
-
it { should respond_to(:objects) }
|
10
|
-
it { should respond_to(:objects=) }
|
7
|
+
it { should have_accessor(:name) }
|
8
|
+
it { should have_accessor(:objects) }
|
11
9
|
|
12
10
|
describe '#add' do
|
13
11
|
it 'adds objects to be packed later' do
|
@@ -4,21 +4,13 @@ describe GroupDocs::Subscription::Limit do
|
|
4
4
|
|
5
5
|
it_behaves_like GroupDocs::Api::Entity
|
6
6
|
|
7
|
-
it { should
|
8
|
-
it { should
|
9
|
-
it { should
|
10
|
-
it { should
|
11
|
-
it { should respond_to(:Max) }
|
12
|
-
it { should respond_to(:Max=) }
|
13
|
-
it { should respond_to(:Description) }
|
14
|
-
it { should respond_to(:Description=) }
|
7
|
+
it { should have_accessor(:Id) }
|
8
|
+
it { should have_accessor(:Min) }
|
9
|
+
it { should have_accessor(:Max) }
|
10
|
+
it { should have_accessor(:Description) }
|
15
11
|
|
16
|
-
it { should
|
17
|
-
it { should
|
18
|
-
it { should
|
19
|
-
it { should
|
20
|
-
it { should have_alias(:max, :Max) }
|
21
|
-
it { should have_alias(:max=, :Max=) }
|
22
|
-
it { should have_alias(:description, :Description) }
|
23
|
-
it { should have_alias(:description=, :Description=) }
|
12
|
+
it { should alias_accessor(:id, :Id) }
|
13
|
+
it { should alias_accessor(:min, :Min) }
|
14
|
+
it { should alias_accessor(:max, :Max) }
|
15
|
+
it { should alias_accessor(:description, :Description) }
|
24
16
|
end
|
@@ -40,33 +40,22 @@ describe GroupDocs::Subscription do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
it { should
|
44
|
-
it { should
|
45
|
-
it { should
|
46
|
-
it { should
|
47
|
-
it { should
|
48
|
-
it { should respond_to(:PricingPlanId=) }
|
49
|
-
it { should respond_to(:Price) }
|
50
|
-
it { should respond_to(:Price=) }
|
51
|
-
it { should respond_to(:CurrencyCode) }
|
52
|
-
it { should respond_to(:CurrencyCode=) }
|
43
|
+
it { should have_accessor(:Id) }
|
44
|
+
it { should have_accessor(:Name) }
|
45
|
+
it { should have_accessor(:PricingPlanId) }
|
46
|
+
it { should have_accessor(:Price) }
|
47
|
+
it { should have_accessor(:CurrencyCode) }
|
53
48
|
|
54
|
-
it { should
|
55
|
-
it { should
|
56
|
-
it { should
|
57
|
-
it { should
|
58
|
-
it { should
|
59
|
-
it { should have_alias(:pricing_plan_id=, :PricingPlanId=) }
|
60
|
-
it { should have_alias(:price, :Price) }
|
61
|
-
it { should have_alias(:price=, :Price=) }
|
62
|
-
it { should have_alias(:currency_code, :CurrencyCode) }
|
63
|
-
it { should have_alias(:currency_code=, :CurrencyCode=) }
|
49
|
+
it { should alias_accessor(:id, :Id) }
|
50
|
+
it { should alias_accessor(:name, :Name) }
|
51
|
+
it { should alias_accessor(:pricing_plan_id, :PricingPlanId) }
|
52
|
+
it { should alias_accessor(:price, :Price) }
|
53
|
+
it { should alias_accessor(:currency_code, :CurrencyCode) }
|
64
54
|
|
65
55
|
it { should have_alias(:ref_id=, :id=) }
|
66
56
|
|
67
57
|
GroupDocs::Subscription::LIMITS.each do |snake, camel|
|
68
|
-
it { should
|
69
|
-
it { should respond_to(:"#{camel}=") }
|
58
|
+
it { should have_accessor(camel) }
|
70
59
|
|
71
60
|
# reader is overwritten
|
72
61
|
it { should have_alias(:"#{snake}=", :"#{camel}=") }
|
data/spec/groupdocs/user_spec.rb
CHANGED
@@ -20,47 +20,27 @@ describe GroupDocs::User do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
it { should
|
24
|
-
it { should
|
25
|
-
it { should
|
26
|
-
it { should
|
27
|
-
it { should
|
28
|
-
it { should
|
29
|
-
it { should
|
30
|
-
it { should
|
31
|
-
it { should
|
32
|
-
it { should
|
33
|
-
it { should
|
34
|
-
it { should
|
35
|
-
it { should
|
36
|
-
it { should
|
37
|
-
it { should
|
38
|
-
it { should
|
39
|
-
it { should
|
40
|
-
|
41
|
-
it { should
|
42
|
-
it { should
|
43
|
-
it { should
|
44
|
-
it { should respond_to(:storage=) }
|
45
|
-
it { should respond_to(:photo) }
|
46
|
-
it { should respond_to(:photo=) }
|
47
|
-
it { should respond_to(:active) }
|
48
|
-
it { should respond_to(:active=) }
|
49
|
-
it { should respond_to(:news_enabled) }
|
50
|
-
it { should respond_to(:news_enabled=) }
|
51
|
-
it { should respond_to(:signed_up_on) }
|
52
|
-
it { should respond_to(:signed_up_on=) }
|
53
|
-
it { should respond_to(:color) }
|
54
|
-
it { should respond_to(:color=) }
|
55
|
-
it { should respond_to(:customEmailMessage) }
|
56
|
-
it { should respond_to(:customEmailMessage=) }
|
57
|
-
|
58
|
-
it { should have_alias(:first_name, :firstname) }
|
59
|
-
it { should have_alias(:first_name=, :firstname=) }
|
60
|
-
it { should have_alias(:last_name, :lastname) }
|
61
|
-
it { should have_alias(:last_name=, :lastname=) }
|
62
|
-
it { should have_alias(:custom_email_message, :customEmailMessage) }
|
63
|
-
it { should have_alias(:custom_email_message=, :customEmailMessage=) }
|
23
|
+
it { should have_accessor(:id) }
|
24
|
+
it { should have_accessor(:guid) }
|
25
|
+
it { should have_accessor(:nickname) }
|
26
|
+
it { should have_accessor(:firstname) }
|
27
|
+
it { should have_accessor(:lastname) }
|
28
|
+
it { should have_accessor(:primary_email) }
|
29
|
+
it { should have_accessor(:private_key) }
|
30
|
+
it { should have_accessor(:password_salt) }
|
31
|
+
it { should have_accessor(:claimed_id) }
|
32
|
+
it { should have_accessor(:token) }
|
33
|
+
it { should have_accessor(:storage) }
|
34
|
+
it { should have_accessor(:photo) }
|
35
|
+
it { should have_accessor(:active) }
|
36
|
+
it { should have_accessor(:news_enabled) }
|
37
|
+
it { should have_accessor(:signed_up_on) }
|
38
|
+
it { should have_accessor(:color) }
|
39
|
+
it { should have_accessor(:customEmailMessage) }
|
40
|
+
|
41
|
+
it { should alias_accessor(:first_name, :firstname) }
|
42
|
+
it { should alias_accessor(:last_name, :lastname) }
|
43
|
+
it { should alias_accessor(:custom_email_message, :customEmailMessage) }
|
64
44
|
|
65
45
|
it { should have_alias(:pkey=, :private_key=) }
|
66
46
|
it { should have_alias(:pswd_salt=, :password_salt=) }
|
data/spec/groupdocs_spec.rb
CHANGED
@@ -34,14 +34,10 @@ describe GroupDocs do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
it { should
|
38
|
-
it { should
|
39
|
-
it { should
|
40
|
-
it { should
|
41
|
-
it { should respond_to(:api_server) }
|
42
|
-
it { should respond_to(:api_server=) }
|
43
|
-
it { should respond_to(:api_version) }
|
44
|
-
it { should respond_to(:api_version=) }
|
37
|
+
it { should have_accessor(:client_id) }
|
38
|
+
it { should have_accessor(:private_key) }
|
39
|
+
it { should have_accessor(:api_server) }
|
40
|
+
it { should have_accessor(:api_version) }
|
45
41
|
|
46
42
|
describe '#api_server' do
|
47
43
|
it 'returns default URL if it has not been overwritten' do
|
data/spec/spec_helper.rb
CHANGED
@@ -12,12 +12,24 @@ require 'groupdocs'
|
|
12
12
|
Dir['spec/support/shared_examples/**/*.rb'].each { |file| file = file.sub(/spec\//, ''); require file }
|
13
13
|
|
14
14
|
# matchers extension
|
15
|
+
RSpec::Matchers.define :have_accessor do |name|
|
16
|
+
match do |object|
|
17
|
+
object.should respond_to(:"#{name}")
|
18
|
+
object.should respond_to(:"#{name}=")
|
19
|
+
end
|
20
|
+
end
|
15
21
|
RSpec::Matchers.define :have_alias do |aliased, original|
|
16
22
|
match do |object|
|
17
23
|
object.should respond_to(aliased)
|
18
24
|
object.method(aliased).should == object.method(original)
|
19
25
|
end
|
20
26
|
end
|
27
|
+
RSpec::Matchers.define :alias_accessor do |aliased, original|
|
28
|
+
match do |object|
|
29
|
+
object.should have_alias(:"#{aliased}", :"#{original}")
|
30
|
+
object.should have_alias(:"#{aliased}=", :"#{original}=")
|
31
|
+
end
|
32
|
+
end
|
21
33
|
|
22
34
|
# configure API access
|
23
35
|
RSpec.configure do |spec|
|
Binary file
|
@@ -10,15 +10,15 @@
|
|
10
10
|
"sessionGuid": null,
|
11
11
|
"box":
|
12
12
|
{
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
13
|
+
"x": 0.8938259,
|
14
|
+
"y": 0.31941694,
|
15
|
+
"width": 0.0457534268,
|
16
|
+
"height": 0.01388945
|
17
17
|
},
|
18
18
|
"annotationPosition":
|
19
19
|
{
|
20
|
-
"
|
21
|
-
"
|
20
|
+
"x": null,
|
21
|
+
"y": null
|
22
22
|
},
|
23
23
|
"type": "Text",
|
24
24
|
"access": "Public",
|
@@ -14,10 +14,10 @@
|
|
14
14
|
},
|
15
15
|
"box":
|
16
16
|
{
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
17
|
+
"x": 0.8938259,
|
18
|
+
"y": 0.31941694,
|
19
|
+
"width": 0.0457534268,
|
20
|
+
"height": 0.01388945
|
21
21
|
},
|
22
22
|
"text": "This part was deleted"
|
23
23
|
},
|
@@ -32,10 +32,10 @@
|
|
32
32
|
},
|
33
33
|
"box":
|
34
34
|
{
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
35
|
+
"x": 0.34985,
|
36
|
+
"y": 0.3476543,
|
37
|
+
"width": 0.2374,
|
38
|
+
"height": 0.4765943
|
39
39
|
},
|
40
40
|
"text": "This part was inserted"
|
41
41
|
}
|