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
@@ -39,14 +39,10 @@ module GroupDocs
|
|
39
39
|
attr_accessor :canDelegate
|
40
40
|
|
41
41
|
# Human-readable accessors
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
alias_method :can_annotate, :canAnnotate
|
47
|
-
alias_method :can_annotate=, :canAnnotate=
|
48
|
-
alias_method :can_delegate, :canDelegate
|
49
|
-
alias_method :can_delegate=, :canDelegate=
|
42
|
+
alias_accessor :can_edit, :canEdit
|
43
|
+
alias_accessor :can_sign, :canSign
|
44
|
+
alias_accessor :can_annotate, :canAnnotate
|
45
|
+
alias_accessor :can_delegate, :canDelegate
|
50
46
|
|
51
47
|
#
|
52
48
|
# Returns true if role can edit.
|
@@ -8,6 +8,8 @@ module GroupDocs
|
|
8
8
|
#
|
9
9
|
module EntityFields
|
10
10
|
|
11
|
+
extend Api::Helpers::Accessor
|
12
|
+
|
11
13
|
# @attr [String] id
|
12
14
|
attr_accessor :id
|
13
15
|
# @attr [String] name
|
@@ -36,26 +38,16 @@ module GroupDocs
|
|
36
38
|
attr_accessor :recipients
|
37
39
|
|
38
40
|
# Human-readable accessors
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
alias_method :ordered_signature, :orderedSignature
|
50
|
-
alias_method :ordered_signature=, :orderedSignature=
|
51
|
-
alias_method :email_subject, :emailSubject
|
52
|
-
alias_method :email_subject=, :emailSubject=
|
53
|
-
alias_method :email_body, :emailBody
|
54
|
-
alias_method :email_body=, :emailBody=
|
55
|
-
alias_method :documents_count, :documentsCount
|
56
|
-
alias_method :documents_count=, :documentsCount=
|
57
|
-
alias_method :documents_pages, :documentsPages
|
58
|
-
alias_method :documents_pages=, :documentsPages=
|
41
|
+
alias_accessor :owner_id, :ownerId
|
42
|
+
alias_accessor :owner_guid, :ownerGuid
|
43
|
+
alias_accessor :reminder_time, :reminderTime
|
44
|
+
alias_accessor :step_expire_time, :stepExpireTime
|
45
|
+
alias_accessor :owner_should_sign, :ownerShouldSign
|
46
|
+
alias_accessor :ordered_signature, :orderedSignature
|
47
|
+
alias_accessor :email_subject, :emailSubject
|
48
|
+
alias_accessor :email_body, :emailBody
|
49
|
+
alias_accessor :documents_count, :documentsCount
|
50
|
+
alias_accessor :documents_pages, :documentsPages
|
59
51
|
|
60
52
|
#
|
61
53
|
# Converts each recipient to GroupDocs::Signature::Recipient object.
|
@@ -37,8 +37,7 @@ module GroupDocs
|
|
37
37
|
attr_accessor :templateExpireTime
|
38
38
|
|
39
39
|
# Human-readable accessors
|
40
|
-
|
41
|
-
alias_method :template_expire_time=, :templateExpireTime=
|
40
|
+
alias_accessor :template_expire_time, :templateExpireTime
|
42
41
|
|
43
42
|
#
|
44
43
|
# Adds recipient to template.
|
@@ -98,6 +98,8 @@ module GroupDocs
|
|
98
98
|
attr_accessor :access
|
99
99
|
# @attr [String] path
|
100
100
|
attr_accessor :path
|
101
|
+
# @attr [String] local_path
|
102
|
+
attr_accessor :local_path
|
101
103
|
|
102
104
|
# Compatibility with response JSON
|
103
105
|
alias_method :adj_name=, :name=
|
@@ -175,7 +177,7 @@ module GroupDocs
|
|
175
177
|
response = Api::Request.new do |request|
|
176
178
|
request[:access] = access
|
177
179
|
request[:method] = :DOWNLOAD
|
178
|
-
request[:path] = "/storage/{{client_id}}/files/#{
|
180
|
+
request[:path] = "/storage/{{client_id}}/files/#{guid}"
|
179
181
|
end.execute!
|
180
182
|
|
181
183
|
filepath = "#{path}/#{name}"
|
@@ -105,13 +105,19 @@ module GroupDocs
|
|
105
105
|
# @option options [Integer] :count How many items to list
|
106
106
|
# @option options [String] :order_by Field name to sort by
|
107
107
|
# @option options [Boolean] :order_asc Set to true to return in ascending order
|
108
|
+
# @option options [String] :filter Filter by name
|
109
|
+
# @option options [Array<Symbol>] :file_types Array of file types to return
|
110
|
+
# @option options [Boolean] :extended Set to true to return extended information
|
108
111
|
# @param [Hash] access Access credentials
|
109
112
|
# @option access [String] :client_id
|
110
113
|
# @option access [String] :private_key
|
111
114
|
# @return [Array<GroupDocs::Storage::Folder, GroupDocs::Storage::File>]
|
112
115
|
#
|
113
116
|
def list!(options = {}, access = {})
|
114
|
-
|
117
|
+
if options[:order_by]
|
118
|
+
options[:order_by] = accessor_to_variable(options[:order_by].capitalize).to_s.delete(?@)
|
119
|
+
end
|
120
|
+
|
115
121
|
full_path = prepare_path("#{path}/#{name}")
|
116
122
|
|
117
123
|
api = Api::Request.new do |request|
|
@@ -75,16 +75,11 @@ module GroupDocs
|
|
75
75
|
attr_accessor :CurrencyCode
|
76
76
|
|
77
77
|
# Human-readable accessors
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
alias_method :pricing_plan_id=, :PricingPlanId=
|
84
|
-
alias_method :price, :Price
|
85
|
-
alias_method :price=, :Price=
|
86
|
-
alias_method :currency_code, :CurrencyCode
|
87
|
-
alias_method :currency_code=, :CurrencyCode=
|
78
|
+
alias_accessor :id, :Id
|
79
|
+
alias_accessor :name, :Name
|
80
|
+
alias_accessor :pricing_plan_id, :PricingPlanId
|
81
|
+
alias_accessor :price, :Price
|
82
|
+
alias_accessor :currency_code, :CurrencyCode
|
88
83
|
|
89
84
|
# Compatibility with response JSON
|
90
85
|
alias_method :ref_id=, :id=
|
@@ -97,8 +92,7 @@ module GroupDocs
|
|
97
92
|
attr_accessor camel
|
98
93
|
|
99
94
|
# Human-readable accessors
|
100
|
-
|
101
|
-
alias_method :"#{snake}=", :"#{camel}="
|
95
|
+
alias_accessor snake, camel.to_sym
|
102
96
|
|
103
97
|
#
|
104
98
|
# Converts hash to subscription plan limit.
|
@@ -11,14 +11,10 @@ module GroupDocs
|
|
11
11
|
attr_accessor :Description
|
12
12
|
|
13
13
|
# Human-readable accessors
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
alias_method :max, :Max
|
19
|
-
alias_method :max=, :Max=
|
20
|
-
alias_method :description, :Description
|
21
|
-
alias_method :description=, :Description=
|
14
|
+
alias_accessor :id, :Id
|
15
|
+
alias_accessor :min, :Min
|
16
|
+
alias_accessor :max, :Max
|
17
|
+
alias_accessor :description, :Description
|
22
18
|
|
23
19
|
end # Subscription::Limit
|
24
20
|
end # GroupDocs
|
data/lib/groupdocs/user.rb
CHANGED
@@ -62,12 +62,9 @@ module GroupDocs
|
|
62
62
|
attr_accessor :customEmailMessage
|
63
63
|
|
64
64
|
# Human-readable accessors
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
alias_method :last_name=, :lastname=
|
69
|
-
alias_method :custom_email_message, :customEmailMessage
|
70
|
-
alias_method :custom_email_message=, :customEmailMessage=
|
65
|
+
alias_accessor :first_name, :firstname
|
66
|
+
alias_accessor :last_name, :lastname
|
67
|
+
alias_accessor :custom_email_message, :customEmailMessage
|
71
68
|
|
72
69
|
#
|
73
70
|
# Converts access rights to human-readable format flag.
|
data/lib/groupdocs/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GroupDocs::Api::Helpers::Accessor do
|
4
|
+
describe '.alias_accessor' do
|
5
|
+
it 'aliases accessor to new name' do
|
6
|
+
klass = GroupDocs::Api::Entity
|
7
|
+
klass.class_eval <<-RUBY
|
8
|
+
attr_accessor :guid
|
9
|
+
alias_accessor :guiD, :guid
|
10
|
+
RUBY
|
11
|
+
subject = klass.new
|
12
|
+
subject.should have_alias(:guiD, :guid)
|
13
|
+
subject.should have_alias(:guiD=, :guid=)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GroupDocs::Api::Helpers::MIME do
|
4
|
+
subject do
|
5
|
+
GroupDocs::Signature.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#mime_type' do
|
9
|
+
it 'returns first MIME type of file' do
|
10
|
+
types = ['application/ruby']
|
11
|
+
::MIME::Types.should_receive(:type_for).with(__FILE__).and_return(types)
|
12
|
+
types.should_receive(:first).and_return('application/ruby')
|
13
|
+
subject.send(:mime_type, __FILE__)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -16,6 +16,10 @@ describe GroupDocs::Api::Helpers::REST do
|
|
16
16
|
it 'includes "Content-length: 0"' do
|
17
17
|
subject.should include(content_length: 0)
|
18
18
|
end
|
19
|
+
|
20
|
+
it 'includes Groupdocs-Referrer with SDK version' do
|
21
|
+
subject.should include(groupdocs_referrer: "ruby/#{GroupDocs::VERSION}")
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
describe '#prepare_request' do
|
@@ -4,11 +4,9 @@ describe GroupDocs::Api::Request do
|
|
4
4
|
|
5
5
|
subject { described_class.new(method: :GET, path: '/folders') }
|
6
6
|
|
7
|
-
it { should respond_to(:resource)
|
8
|
-
it { should
|
9
|
-
it { should
|
10
|
-
it { should respond_to(:options) }
|
11
|
-
it { should respond_to(:options=) }
|
7
|
+
it { should respond_to(:resource) }
|
8
|
+
it { should have_accessor(:response) }
|
9
|
+
it { should have_accessor(:options) }
|
12
10
|
|
13
11
|
describe '#initialize' do
|
14
12
|
it 'allows passing options' do
|
@@ -4,12 +4,9 @@ describe GroupDocs::DataSource::Field 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 respond_to(:type=) }
|
11
|
-
it { should respond_to(:values) }
|
12
|
-
it { should respond_to(:values=) }
|
7
|
+
it { should have_accessor(:name) }
|
8
|
+
it { should have_accessor(:type) }
|
9
|
+
it { should have_accessor(:values) }
|
13
10
|
|
14
11
|
describe '#type=' do
|
15
12
|
it 'saves type in machine readable format if symbol is passed' do
|
@@ -31,21 +31,14 @@ describe GroupDocs::DataSource do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
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 respond_to(:modified_on) }
|
43
|
-
it { should respond_to(:modified_on=) }
|
44
|
-
it { should respond_to(:fields) }
|
45
|
-
it { should respond_to(:fields=) }
|
46
|
-
|
47
|
-
it { should have_alias(:description, :descr) }
|
48
|
-
it { should have_alias(:description=, :descr=) }
|
34
|
+
it { should have_accessor(:id) }
|
35
|
+
it { should have_accessor(:descr) }
|
36
|
+
it { should have_accessor(:questionnaire_id) }
|
37
|
+
it { should have_accessor(:created_on) }
|
38
|
+
it { should have_accessor(:modified_on) }
|
39
|
+
it { should have_accessor(:fields) }
|
40
|
+
|
41
|
+
it { should alias_accessor(:description, :descr) }
|
49
42
|
|
50
43
|
describe '#created_on' do
|
51
44
|
it 'returns converted to Time object Unix timestamp' do
|
@@ -56,31 +56,20 @@ describe GroupDocs::Document::Annotation::Reply do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
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
|
-
|
68
|
-
it { should
|
69
|
-
it { should
|
70
|
-
it { should
|
71
|
-
it { should respond_to(:text) }
|
72
|
-
it { should respond_to(:text=) }
|
73
|
-
it { should respond_to(:repliedOn) }
|
74
|
-
it { should respond_to(:repliedOn=) }
|
75
|
-
|
76
|
-
it { should have_alias(:annotation_guid, :annotationGuid) }
|
77
|
-
it { should have_alias(:annotation_guid=, :annotationGuid=) }
|
78
|
-
it { should have_alias(:user_guid, :userGuid) }
|
79
|
-
it { should have_alias(:user_guid=, :userGuid=) }
|
80
|
-
it { should have_alias(:user_name, :userName) }
|
81
|
-
it { should have_alias(:user_name=, :userName=) }
|
59
|
+
it { should have_accessor(:annotation) }
|
60
|
+
it { should have_accessor(:text) }
|
61
|
+
it { should have_accessor(:guid) }
|
62
|
+
it { should have_accessor(:annotationGuid) }
|
63
|
+
it { should have_accessor(:userGuid) }
|
64
|
+
it { should have_accessor(:userName) }
|
65
|
+
it { should have_accessor(:text) }
|
66
|
+
it { should have_accessor(:repliedOn) }
|
67
|
+
|
68
|
+
it { should alias_accessor(:annotation_guid, :annotationGuid) }
|
69
|
+
it { should alias_accessor(:user_guid, :userGuid) }
|
70
|
+
it { should alias_accessor(:user_name, :userName) }
|
82
71
|
# Reply#replied_on is overwritten
|
83
|
-
it { should have_alias(:replied_on=, :repliedOn=)
|
72
|
+
it { should have_alias(:replied_on=, :repliedOn=) }
|
84
73
|
|
85
74
|
|
86
75
|
describe '#initialize' do
|
@@ -45,13 +45,9 @@ describe GroupDocs::Document::Annotation::Reviewer do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
it { should
|
49
|
-
it { should
|
50
|
-
|
51
|
-
it { should
|
52
|
-
|
53
|
-
it { should have_alias(:email_address, :emailAddress) }
|
54
|
-
it { should have_alias(:email_address=, :emailAddress=) }
|
55
|
-
it { should have_alias(:full_name, :FullName) }
|
56
|
-
it { should have_alias(:full_name=, :FullName=) }
|
48
|
+
it { should have_accessor(:emailAddress) }
|
49
|
+
it { should have_accessor(:FullName) }
|
50
|
+
|
51
|
+
it { should alias_accessor(:email_address, :emailAddress) }
|
52
|
+
it { should alias_accessor(:full_name, :FullName) }
|
57
53
|
end
|
@@ -11,46 +11,28 @@ describe GroupDocs::Document::Annotation do
|
|
11
11
|
described_class.new(document: document)
|
12
12
|
end
|
13
13
|
|
14
|
-
it { should
|
15
|
-
it { should
|
16
|
-
it { should
|
17
|
-
it { should
|
18
|
-
it { should
|
19
|
-
it { should
|
20
|
-
it { should
|
21
|
-
it { should
|
22
|
-
it { should
|
23
|
-
it { should
|
24
|
-
it { should
|
25
|
-
it { should
|
26
|
-
it { should
|
27
|
-
|
28
|
-
it { should
|
29
|
-
it { should
|
30
|
-
it { should
|
31
|
-
it { should
|
32
|
-
it { should respond_to(:access) }
|
33
|
-
it { should respond_to(:access=) }
|
34
|
-
it { should respond_to(:box) }
|
35
|
-
it { should respond_to(:box=) }
|
36
|
-
it { should respond_to(:replies) }
|
37
|
-
it { should respond_to(:replies=) }
|
38
|
-
it { should respond_to(:annotationPosition) }
|
39
|
-
it { should respond_to(:annotationPosition=) }
|
40
|
-
|
41
|
-
it { should have_alias(:session_guid, :sessionGuid) }
|
42
|
-
it { should have_alias(:session_guid=, :sessionGuid=) }
|
43
|
-
it { should have_alias(:document_guid, :documentGuid) }
|
44
|
-
it { should have_alias(:document_guid=, :documentGuid=) }
|
45
|
-
it { should have_alias(:creator_guid, :creatorGuid) }
|
46
|
-
it { should have_alias(:creator_guid=, :creatorGuid=) }
|
47
|
-
it { should have_alias(:reply_guid, :replyGuid) }
|
48
|
-
it { should have_alias(:reply_guid=, :replyGuid=) }
|
14
|
+
it { should have_accessor(:document) }
|
15
|
+
it { should have_accessor(:id) }
|
16
|
+
it { should have_accessor(:guid) }
|
17
|
+
it { should have_accessor(:sessionGuid) }
|
18
|
+
it { should have_accessor(:documentGuid) }
|
19
|
+
it { should have_accessor(:creatorGuid) }
|
20
|
+
it { should have_accessor(:replyGuid) }
|
21
|
+
it { should have_accessor(:createdOn) }
|
22
|
+
it { should have_accessor(:type) }
|
23
|
+
it { should have_accessor(:access) }
|
24
|
+
it { should have_accessor(:box) }
|
25
|
+
it { should have_accessor(:replies) }
|
26
|
+
it { should have_accessor(:annotationPosition) }
|
27
|
+
|
28
|
+
it { should alias_accessor(:session_guid, :sessionGuid) }
|
29
|
+
it { should alias_accessor(:document_guid, :documentGuid) }
|
30
|
+
it { should alias_accessor(:creator_guid, :creatorGuid) }
|
31
|
+
it { should alias_accessor(:reply_guid, :replyGuid) }
|
49
32
|
# Annotation#created_on is overwritten
|
50
|
-
it { should have_alias(:created_on=, :createdOn=)
|
51
|
-
it { should
|
52
|
-
it { should
|
53
|
-
it { should have_alias(:position, :annotation_position) }
|
33
|
+
it { should have_alias(:created_on=, :createdOn=) }
|
34
|
+
it { should alias_accessor(:annotation_position, :annotationPosition) }
|
35
|
+
it { should alias_accessor(:position, :annotationPosition) }
|
54
36
|
|
55
37
|
it { should have_alias(:annotationGuid=, :guid=) }
|
56
38
|
|
@@ -108,7 +90,7 @@ describe GroupDocs::Document::Annotation do
|
|
108
90
|
|
109
91
|
describe '#box=' do
|
110
92
|
it 'converts passed hash to GroupDocs::Document::Rectangle object' do
|
111
|
-
subject.box = {
|
93
|
+
subject.box = { x: 0.90, y: 0.05, width: 0.06745, height: 0.005967 }
|
112
94
|
subject.box.should be_a(GroupDocs::Document::Rectangle)
|
113
95
|
subject.box.x.should == 0.90
|
114
96
|
subject.box.y.should == 0.05
|
@@ -231,6 +213,19 @@ describe GroupDocs::Document::Annotation do
|
|
231
213
|
subject.move_marker!(10, 10, client_id: 'client_id', private_key: 'private_key')
|
232
214
|
end.should_not raise_error(ArgumentError)
|
233
215
|
end
|
216
|
+
|
217
|
+
it 'updates box coordinates if it is set' do
|
218
|
+
subject.box = { x: 1, y: 2 }
|
219
|
+
subject.move_marker! 10, 10
|
220
|
+
subject.box.x.should == 10
|
221
|
+
subject.box.y.should == 10
|
222
|
+
end
|
223
|
+
|
224
|
+
it 'creates box coordinates if it is not set' do
|
225
|
+
subject.move_marker! 10, 10
|
226
|
+
subject.box.x.should == 10
|
227
|
+
subject.box.y.should == 10
|
228
|
+
end
|
234
229
|
end
|
235
230
|
|
236
231
|
describe '#set_access!' do
|