rightsignature 1.0.4 → 1.0.5

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.
@@ -311,11 +311,11 @@ module RightSignature
311
311
 
312
312
  signer_links = []
313
313
 
314
- if response["document"]["signer_links"]["signer_link"].is_a? Array
314
+ if response["document"]["signer_links"] && response["document"]["signer_links"]["signer_link"].is_a?(Array)
315
315
  response["document"]["signer_links"]["signer_link"].each do |signer_link|
316
316
  signer_links << {"name" => signer_link["name"], "url" => "#{site}/signatures/embedded?rt=#{signer_link["signer_token"]}"}
317
317
  end
318
- else
318
+ elsif response["document"]["signer_links"]
319
319
  signer_link = response["document"]["signer_links"]["signer_link"]
320
320
  signer_links << {"name" => signer_link["name"], "url" => "#{site}/signatures/embedded?rt=#{signer_link["signer_token"]}"}
321
321
  end
@@ -1,3 +1,3 @@
1
1
  module RightSignature
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -280,6 +280,13 @@ describe RightSignature::Document do
280
280
  response.include?({"name" => "Righty Jones", "url" => "#{@rs.site}/signatures/embedded?rt=fdh89"}).should be_true
281
281
  end
282
282
 
283
+ it "should GET /api/documents/GUID123/signer_links.xml and return [] for no signers" do
284
+ @rs.should_receive(:get).with("/api/documents/GUID123/signer_links.xml", {}).and_return({'document' => {'signer_links' => nil}})
285
+
286
+ response = @rs.get_document_signer_links_for("GUID123")
287
+ response.should == []
288
+ end
289
+
283
290
  it "should GET /api/documents/GUID123/signer_links.xml with URI encoded redirect location and return urls for 1 signer_link" do
284
291
  @rs.should_receive(:get).with("/api/documents/GUID123/signer_links.xml", {:redirect_location => "http://google.com/redirected%20location"}
285
292
  ).and_return({'document' => {'signer_links' => {'signer_link' =>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rightsignature
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-02-07 00:00:00.000000000 Z
14
+ date: 2013-03-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler