docusigner 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docusigner.gemspec +1 -1
- data/lib/docusigner/envelope.rb +7 -2
- data/test/unit/envelope_test.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e308de0e48a638a4e8ae7e9d65b86ea06079a2da
|
4
|
+
data.tar.gz: 4c15cab0081059dd4033f2692eac1077b65f303d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30f7039762339f2fc09bdc5dff8465b555154e8eb70ec74660cf61bef9a2df45913ea37eb6435057dfa616f3808082f9b922960cdac569d6eeb82cf370d06f52
|
7
|
+
data.tar.gz: 8276261b6391d1f1c9e21379da1066d9850ca286c8e8e7cc905a7d9386dcaea23aa9176f1f518385efe17e077eb5e0da1801f4d58ba5a7ec27ea653ecd419f65
|
data/docusigner.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "docusigner"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.5"
|
4
4
|
s.description = "Unofficial gem for accessing the DocuSign REST API"
|
5
5
|
s.summary = "Unofficial gem for accessing the DocuSign REST API"
|
6
6
|
s.add_dependency "reactive_resource", ">= 0.7.3"
|
data/lib/docusigner/envelope.rb
CHANGED
@@ -16,13 +16,18 @@ module Docusigner
|
|
16
16
|
CORRECT = "correct"
|
17
17
|
end
|
18
18
|
|
19
|
+
self.primary_key = "envelopeId"
|
20
|
+
|
19
21
|
belongs_to :account
|
20
22
|
|
21
23
|
has_many :documents
|
22
24
|
has_many :recipients
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
+
class << self
|
27
|
+
def recipient_url(id, prefix_options = {}, params = {})
|
28
|
+
resp = post("#{id}/views/recipient", prefix_options, params.to_json)
|
29
|
+
format.decode(resp.body)
|
30
|
+
end
|
26
31
|
end
|
27
32
|
|
28
33
|
def send!
|
data/test/unit/envelope_test.rb
CHANGED
@@ -109,6 +109,27 @@ class Docusigner::EnvelopeTest < Test::Unit::TestCase
|
|
109
109
|
:clientUserId => 333,
|
110
110
|
:recipientId => 1
|
111
111
|
})
|
112
|
+
|
113
|
+
assert_requested(:post, "https://demo.docusign.net/restapi/v2/accounts/1234-asdf/envelopes/qwer-7890/views/recipient.json")
|
114
|
+
assert_equal("http://localhost/Member/StartInSession.aspx?t=d1cf42f2-30b6-499b-ab54-058fbf438103", url)
|
115
|
+
end
|
116
|
+
|
117
|
+
should "be able to get recipient view url using the class method" do
|
118
|
+
stub_request(:post, "https://demo.docusign.net/restapi/v2/accounts/1234-asdf/envelopes/qwer-7890/views/recipient.json")
|
119
|
+
.to_return(:body => {
|
120
|
+
"url" => "http://localhost/Member/StartInSession.aspx?t=d1cf42f2-30b6-499b-ab54-058fbf438103"
|
121
|
+
}.to_json)
|
122
|
+
|
123
|
+
params = {
|
124
|
+
:authenticationMethod => "email",
|
125
|
+
:email => "mike.rosey@docusign.com",
|
126
|
+
:returnUrl => "http://www.docusign.com",
|
127
|
+
:userName => "Mike Rosey",
|
128
|
+
:clientUserId => 333,
|
129
|
+
:recipientId => 1
|
130
|
+
}
|
131
|
+
|
132
|
+
url = Docusigner::Envelope.recipient_url(@envelope.id, @envelope.prefix_options, params)
|
112
133
|
assert_requested(:post, "https://demo.docusign.net/restapi/v2/accounts/1234-asdf/envelopes/qwer-7890/views/recipient.json")
|
113
134
|
assert_equal("http://localhost/Member/StartInSession.aspx?t=d1cf42f2-30b6-499b-ab54-058fbf438103", url)
|
114
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docusigner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Ching
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reactive_resource
|