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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0964916e8ea336d27bdc6bea2404c79bad2898c
4
- data.tar.gz: 908a0932e72d844049eb88819a2bd93678c892cd
3
+ metadata.gz: e308de0e48a638a4e8ae7e9d65b86ea06079a2da
4
+ data.tar.gz: 4c15cab0081059dd4033f2692eac1077b65f303d
5
5
  SHA512:
6
- metadata.gz: 849d75563a679b6264d561980767231b3df9da1e79d86cc1cd5087805d3559e98658b8005b92cea9e8e7fd2822b11ac31d764a982aeb36b5df189dba603a0872
7
- data.tar.gz: 6f41fef50350c7ecd72ed8fc796379e71b4fb66a268341986013e6b66e299262972592e975f2ab750df0cb4bccdc8dcd9acca615fe81d8401c1b7ca8b23b485a
6
+ metadata.gz: 30f7039762339f2fc09bdc5dff8465b555154e8eb70ec74660cf61bef9a2df45913ea37eb6435057dfa616f3808082f9b922960cdac569d6eeb82cf370d06f52
7
+ data.tar.gz: 8276261b6391d1f1c9e21379da1066d9850ca286c8e8e7cc905a7d9386dcaea23aa9176f1f518385efe17e077eb5e0da1801f4d58ba5a7ec27ea653ecd419f65
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "docusigner"
3
- s.version = "0.0.4"
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"
@@ -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
- def id
25
- attributes["envelopeId"]
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!
@@ -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
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-09 00:00:00.000000000 Z
11
+ date: 2013-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reactive_resource