signatory 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +42 -0
- data/History.txt +4 -0
- data/README.rdoc +96 -0
- data/Rakefile +12 -0
- data/lib/signatory/api/base.rb +43 -0
- data/lib/signatory/api/connection.rb +14 -0
- data/lib/signatory/credentials.rb +35 -0
- data/lib/signatory/document.rb +12 -0
- data/lib/signatory/legacy_active_resource_hacks.rb +37 -0
- data/lib/signatory/merge_field.rb +28 -0
- data/lib/signatory/recipient.rb +24 -0
- data/lib/signatory/role.rb +27 -0
- data/lib/signatory/ruby_hacks.rb +7 -0
- data/lib/signatory/template.rb +43 -0
- data/lib/signatory/version.rb +3 -0
- data/lib/signatory.rb +36 -0
- data/signatory.gemspec +28 -0
- data/spec/credentials_spec.rb +39 -0
- data/spec/document_spec.rb +35 -0
- data/spec/fixtures/document.xml.erb +51 -0
- data/spec/fixtures/documents.xml.erb +49 -0
- data/spec/fixtures/template.xml.erb +32 -0
- data/spec/fixtures/template_prepackage.xml.erb +28 -0
- data/spec/fixtures/template_sent.xml.erb +4 -0
- data/spec/fixtures/templates.xml.erb +13 -0
- data/spec/helpers/right_signature_stub.rb +81 -0
- data/spec/merge_field_spec.rb +25 -0
- data/spec/recipient_spec.rb +47 -0
- data/spec/role_spec.rb +25 -0
- data/spec/signatory_spec.rb +32 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/template_spec.rb +79 -0
- metadata +201 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
<page>
|
2
|
+
<total-documents><%= options[:total_documents] %></total-documents>
|
3
|
+
<current-page>1</current-page>
|
4
|
+
<total-pages>1</total-pages>
|
5
|
+
<per-page>10</per-page>
|
6
|
+
<documents>
|
7
|
+
<% options[:total_documents].times do |i| %>
|
8
|
+
<% document = options[:documents][i] %>
|
9
|
+
<document>
|
10
|
+
<completed-at nil="true"></completed-at>
|
11
|
+
<thumbnail-url>http://thumbnailurl.png</thumbnail-url>
|
12
|
+
<message>Please sign this document.</message>
|
13
|
+
<state>pending</state>
|
14
|
+
<pdf-url>http://pdfurl.pdf</pdf-url>
|
15
|
+
<deleted-at nil="true"></deleted-at>
|
16
|
+
<created-at>2009-11-04T10:15:14-08:00</created-at>
|
17
|
+
<is-public>false</is-public>
|
18
|
+
<signed-pdf-url>http://signedpdfurl.pdf</signed-pdf-url>
|
19
|
+
<original-filename>Application.pdf</original-filename>
|
20
|
+
<size>47351</size>
|
21
|
+
<recipients>
|
22
|
+
<recipient>
|
23
|
+
<state>pending</state>
|
24
|
+
<must-sign>true</must-sign>
|
25
|
+
<document-role-id>signer_A</document-role-id>
|
26
|
+
<is-sender>true</is-sender>
|
27
|
+
<email>support@rightsignature.com</email>
|
28
|
+
<name>John Bellingham</name>
|
29
|
+
</recipient>
|
30
|
+
<recipient>
|
31
|
+
<state>signed</state>
|
32
|
+
<must-sign>true</must-sign>
|
33
|
+
<document-role-id>signer_B</document-role-id>
|
34
|
+
<is-sender>false</is-sender>
|
35
|
+
<email>maria@rightsignature.com</email>
|
36
|
+
<name>Maria Montes</name>
|
37
|
+
</recipient>
|
38
|
+
</recipients>
|
39
|
+
<subject><%= document.nil? ? "Employment Application" : document[:subject] %></subject>
|
40
|
+
<guid><%= document.nil? ? 'ABCXYZ' : document[:guid] %></guid>
|
41
|
+
<callback-location>http://callbacklocation.com/gateway</callback-location>
|
42
|
+
<processing-state>done-processing</processing-state>
|
43
|
+
<original-url>http://pdfurl.pdf</original-url>
|
44
|
+
<content-type>pdf</content-type>
|
45
|
+
<expires-on>2009-12-04T16:00:00-08:00</expires-on>
|
46
|
+
</document>
|
47
|
+
<% end %>
|
48
|
+
</documents>
|
49
|
+
</page>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<template>
|
2
|
+
<thumbnail-url>https://thumbnail.png</thumbnail-url>
|
3
|
+
<merge-fields>
|
4
|
+
<merge-field>
|
5
|
+
<page>1</page>
|
6
|
+
<name>Employee Name</name>
|
7
|
+
<id><%= options[:guid] || "a_951_5c0634d166d44916b9e0b3" %></id>
|
8
|
+
</merge-field>
|
9
|
+
</merge-fields>
|
10
|
+
<message>Please sign this document.</message>
|
11
|
+
<created-at>2009-10-28T19:03:26-07:00</created-at>
|
12
|
+
<roles>
|
13
|
+
<role>
|
14
|
+
<must-sign>false</must-sign>
|
15
|
+
<document-role-id>cc_A</document-role-id>
|
16
|
+
<role>Document Sender</role>
|
17
|
+
<is-sender>true</is-sender>
|
18
|
+
</role>
|
19
|
+
<role>
|
20
|
+
<must-sign>true</must-sign>
|
21
|
+
<document-role-id>cc_B</document-role-id>
|
22
|
+
<role>Employer</role>
|
23
|
+
<is-sender>false</is-sender>
|
24
|
+
</role>
|
25
|
+
</roles>
|
26
|
+
<size>3524</size>
|
27
|
+
<subject><%= options[:subject] || "Employment Application Template" %></subject>
|
28
|
+
<guid><%= options[:guid] || "a_951_5c0634d166d44916b9e0b3" %></guid>
|
29
|
+
<processing-state>done-processing</processing-state>
|
30
|
+
<content-type>pdf</content-type>
|
31
|
+
<filename>Application.pdf</filename>
|
32
|
+
</template>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<template>
|
2
|
+
<type>DocumentPackage</type>
|
3
|
+
<merge-fields>
|
4
|
+
<merge-field>
|
5
|
+
<page>1</page>
|
6
|
+
<name>Company Name</name>
|
7
|
+
<id>a_953_8fadb0169d1849b58d1fdd09688e73_5359</id>
|
8
|
+
</merge-field>
|
9
|
+
</merge-fields>
|
10
|
+
<page-breakdown>
|
11
|
+
<page>
|
12
|
+
<original-template-filename>Application.pdf</original-template-filename>
|
13
|
+
<page-number>2</page-number>
|
14
|
+
<original-template-guid>a_311_yDhSZmJDtNExtgJNuSPQFadPoZjfeF</original-template-guid>
|
15
|
+
</page>
|
16
|
+
</page-breakdown>
|
17
|
+
<created-at>2009-11-04T19:49:39-08:00</created-at>
|
18
|
+
<roles>
|
19
|
+
<role>
|
20
|
+
<must-sign>false</must-sign>
|
21
|
+
<document-role-id>cc_A</document-role-id>
|
22
|
+
<role>Employer</role>
|
23
|
+
<is-sender>true</is-sender>
|
24
|
+
</role>
|
25
|
+
</roles>
|
26
|
+
<redirect-token>b14235360ad946daa765c95c67f248a2-2-8fadb0169d1849b58dcb1fdd09688e73</redirect-token>
|
27
|
+
<guid><%= options[:guid] %></guid>
|
28
|
+
</template>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<templates>
|
2
|
+
<% options[:templates].each do |template| %>
|
3
|
+
<template>
|
4
|
+
<thumbnail-url>https://thumbnail.png</thumbnail-url>
|
5
|
+
<message>Please sign this document.</message>
|
6
|
+
<created-at>2009-11-04T14:01:30-08:00</created-at>
|
7
|
+
<subject><%= template[:subject] || "Employment Application Template" %></subject>
|
8
|
+
<guid><%= template[:guid] || "a_951_5c0634d166d44916b9e0b3" %></guid>
|
9
|
+
<processing-state>done-processing</processing-state>
|
10
|
+
<filename>application.pdf</filename>
|
11
|
+
</template>
|
12
|
+
<% end %>
|
13
|
+
</templates>
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'erb'
|
2
|
+
|
3
|
+
module RightSignatureStub
|
4
|
+
def stub_documents(options={})
|
5
|
+
options = {
|
6
|
+
:total_documents => 2,
|
7
|
+
:documents => []
|
8
|
+
}.merge(options)
|
9
|
+
|
10
|
+
stub_request(:get, 'https://rightsignature.com/api/documents.xml').to_return(
|
11
|
+
:body => ERB.new(fixture('documents.xml.erb')).result(binding)
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
def stub_document(id, options={})
|
16
|
+
options = {
|
17
|
+
:guid => id
|
18
|
+
}.merge(options)
|
19
|
+
|
20
|
+
stub_request(:get, "https://rightsignature.com/api/documents/#{id}.xml").to_return(
|
21
|
+
:body => ERB.new(fixture('document.xml.erb')).result(binding)
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def stub_templates(templates=[])
|
26
|
+
options = {
|
27
|
+
:templates => templates
|
28
|
+
}
|
29
|
+
|
30
|
+
stub_request(:get, "https://rightsignature.com/api/templates.xml").to_return(
|
31
|
+
:body => ERB.new(fixture('templates.xml.erb')).result(binding)
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def stub_template(id, options={})
|
36
|
+
options = {
|
37
|
+
:guid => id
|
38
|
+
}.merge(options)
|
39
|
+
|
40
|
+
stub_request(:get, "https://rightsignature.com/api/templates/#{id}.xml").to_return(
|
41
|
+
:body => ERB.new(fixture('template.xml.erb')).result(binding)
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
def stub_template_send(id, doc_id, options = {})
|
46
|
+
options = {
|
47
|
+
:guid => doc_id
|
48
|
+
}.merge(options)
|
49
|
+
|
50
|
+
stub_request(:post, "https://rightsignature.com/api/templates.xml").with do |req|
|
51
|
+
sent = Hash.from_xml(req.body)['template']
|
52
|
+
|
53
|
+
sent['guid'] == id &&
|
54
|
+
sent['action'] == 'send' &&
|
55
|
+
options[:roles].all? { |role|
|
56
|
+
sent['roles']['role'].map{|r|
|
57
|
+
"#{r['name']}:#{r['email']}"
|
58
|
+
}.include?("#{role.name}:#{role.email}")
|
59
|
+
} &&
|
60
|
+
options[:merge_fields].all? {|field|
|
61
|
+
[sent['merge_fields']['merge_field']].flatten.map{|mf|
|
62
|
+
mf['value']
|
63
|
+
}.include?(field.value)
|
64
|
+
}
|
65
|
+
end.to_return(:body => ERB.new(fixture('template_sent.xml.erb')).result(binding))
|
66
|
+
end
|
67
|
+
|
68
|
+
def stub_prepackage(tid, id, options = {})
|
69
|
+
options = {
|
70
|
+
:guid => id
|
71
|
+
}.merge(options)
|
72
|
+
|
73
|
+
stub_request(:post, "https://rightsignature.com/api/templates/#{tid}/prepackage.xml").to_return(
|
74
|
+
:body => ERB.new(fixture('template_prepackage.xml.erb')).result(binding)
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
def fixture(name)
|
79
|
+
File.read(File.join(File.dirname(__FILE__), '..', 'fixtures', name))
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Signatory::MergeField do
|
4
|
+
describe ".to_xml" do
|
5
|
+
it "converts name specified merge field to xml" do
|
6
|
+
mf = Signatory::MergeField.new(:name=>"Company Name", :value=>"Double Rainbow, Inc.")
|
7
|
+
xml = mf.to_xml
|
8
|
+
|
9
|
+
xml.should =~ /<merge_field merge_field_name="Company Name">/
|
10
|
+
hash = Hash.from_xml(xml)
|
11
|
+
hash['merge_field']['value'].should == "Double Rainbow, Inc."
|
12
|
+
hash['merge_field']['locked'].should == "true"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "converts id specified merge field to xml" do
|
16
|
+
mf = Signatory::MergeField.new(:id=>"a_233_f309f82jklnm_232", :value=>"Double Rainbow, Inc.")
|
17
|
+
xml = mf.to_xml
|
18
|
+
|
19
|
+
xml.should =~ /<merge_field merge_field_id="a_233_f309f82jklnm_232">/
|
20
|
+
hash = Hash.from_xml(xml)
|
21
|
+
hash['merge_field']['value'].should == "Double Rainbow, Inc."
|
22
|
+
hash['merge_field']['locked'].should == "true"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Signatory::Recipient do
|
4
|
+
before(:each) do
|
5
|
+
@document = Signatory::Document.new(:guid => 'XXXXX')
|
6
|
+
@recipient = Signatory::Recipient.new(
|
7
|
+
:name => "Bartholomew Davis McDugalheimer",
|
8
|
+
:is_sender => "false",
|
9
|
+
:must_sign => "true",
|
10
|
+
:role_id => "signer_A",
|
11
|
+
:state => "pending",
|
12
|
+
:email => "noemail@rightsignature.com"
|
13
|
+
)
|
14
|
+
@recipient.document = @document
|
15
|
+
stub_request(:get, "https://rightsignature.com/api/documents/XXXXX/signer_links.xml?redirect_location=http%3A%2F%2Fexample.com").
|
16
|
+
to_return(:body => "
|
17
|
+
<document>
|
18
|
+
<signer_links>
|
19
|
+
<signer_link>
|
20
|
+
<role>signer_A</role>
|
21
|
+
<signer_token>YYYY</signer_token>
|
22
|
+
</signer_link>
|
23
|
+
</signer_links>
|
24
|
+
</document>
|
25
|
+
")
|
26
|
+
end
|
27
|
+
|
28
|
+
describe ".embed_url" do
|
29
|
+
it "generates the right url" do
|
30
|
+
@recipient.embed_url('http://example.com').should == "https://rightsignature.com/signatures/embedded?rt=YYYY"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "generates the right url with dimensions" do
|
34
|
+
@recipient.embed_url('http://example.com', :height => 500, :width => 600).should == "https://rightsignature.com/signatures/embedded?height=500&rt=YYYY&width=600"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe ".embed_code" do
|
39
|
+
it "generates the right iframe code" do
|
40
|
+
@recipient.embed_code('http://example.com').should == '<iframe src ="https://rightsignature.com/signatures/embedded?rt=YYYY" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>'
|
41
|
+
end
|
42
|
+
|
43
|
+
it "generates the right iframe code with dimensions" do
|
44
|
+
@recipient.embed_code('http://example.com', :height => 500, :width => 600).should == '<iframe src ="https://rightsignature.com/signatures/embedded?height=500&rt=YYYY&width=600" frameborder="0" scrolling="no" width="600px" height="500px"><p>Your browser does not support iframes.</p></iframe>'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/role_spec.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Signatory::Role do
|
4
|
+
describe ".to_xml" do
|
5
|
+
it "converts name specified roles to xml" do
|
6
|
+
role = Signatory::Role.new(:name=>"RyGar", :role_name=>"Issuer", :email=>"noemail@rightsignature.com")
|
7
|
+
xml = role.to_xml
|
8
|
+
|
9
|
+
xml.should =~ /<role role_name="Issuer">/
|
10
|
+
hash = Hash.from_xml(xml)
|
11
|
+
hash['role']['name'].should == "RyGar"
|
12
|
+
hash['role']['email'].should == "noemail@rightsignature.com"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "converts id specified roles to xml" do
|
16
|
+
role = Signatory::Role.new(:name=>"RyGar", :role_id=>"signer_A", :email=>"noemail@rightsignature.com")
|
17
|
+
xml = role.to_xml
|
18
|
+
|
19
|
+
xml.should =~ /<role role_id="signer_A">/
|
20
|
+
hash = Hash.from_xml(xml)
|
21
|
+
hash['role']['name'].should == "RyGar"
|
22
|
+
hash['role']['email'].should == "noemail@rightsignature.com"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe Signatory do
|
4
|
+
describe ".credentials" do
|
5
|
+
it "takes a Signatory::Credentials" do
|
6
|
+
cred = Signatory::Credentials.new('XXX', 'YYY', 'AAA', 'BBB')
|
7
|
+
Signatory.credentials = cred
|
8
|
+
Signatory.credentials.key.should == 'XXX'
|
9
|
+
Signatory.credentials.secret.should == 'YYY'
|
10
|
+
end
|
11
|
+
|
12
|
+
it "takes a read-able object" do
|
13
|
+
file = StringIO.new("---\nkey: thekey\nsecret: thesecret\naccess_token: accesstoken\naccess_secret: accesssecret")
|
14
|
+
Signatory.credentials = file
|
15
|
+
Signatory.credentials.key.should == 'thekey'
|
16
|
+
Signatory.credentials.secret.should == 'thesecret'
|
17
|
+
end
|
18
|
+
|
19
|
+
it "takes a hash" do
|
20
|
+
Signatory.credentials = {:key => 'key1', :secret => 'secret1', :access_token => 'accesstoken', :access_secret => 'accesssecret'}
|
21
|
+
Signatory.credentials.key.should == 'key1'
|
22
|
+
Signatory.credentials.secret.should == 'secret1'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "uses oauth" do
|
27
|
+
token = Signatory.credentials.token
|
28
|
+
token.should_receive(:get).with('/api/documents/123.xml', {"Accept"=>"application/xml"}).and_return(mock('result', :code => 200, :body => '<document><name>Test</name></document>'))
|
29
|
+
|
30
|
+
Signatory::Document.find('123')
|
31
|
+
end
|
32
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'stringio'
|
3
|
+
require 'rspec'
|
4
|
+
begin
|
5
|
+
require 'webmock/rspec'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'webmock/rspec'
|
9
|
+
end
|
10
|
+
|
11
|
+
Dir[File.join(File.dirname(__FILE__), 'helpers', '*.rb')].each do |f|
|
12
|
+
require f
|
13
|
+
end
|
14
|
+
|
15
|
+
require File.dirname(__FILE__) + '/../lib/signatory'
|
16
|
+
|
17
|
+
Rspec.configure do |c|
|
18
|
+
c.mock_with :rspec
|
19
|
+
c.include WebMock
|
20
|
+
c.include RightSignatureStub
|
21
|
+
|
22
|
+
c.before(:each) do
|
23
|
+
Signatory.credentials = {:key => 'key1', :secret => 'secret1', :access_token => 'accesstoken', :access_secret => 'accesssecret'}
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe Signatory::Template do
|
4
|
+
describe ".all" do
|
5
|
+
it "returns a list of templates" do
|
6
|
+
stub_templates([{:subject => "Template Subject"}, {:subject => "Template Subject 2"}])
|
7
|
+
templates = Signatory::Template.all
|
8
|
+
templates.count.should == 2
|
9
|
+
templates.each do |temp|
|
10
|
+
temp.should be_a(Signatory::Template)
|
11
|
+
end
|
12
|
+
subjects = templates.map{|t| t.subject}
|
13
|
+
subjects.should include("Template Subject")
|
14
|
+
subjects.should include("Template Subject 2")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe ".find by id" do
|
19
|
+
it "returns the template with the specified id" do
|
20
|
+
stub_template('xxxyyy', :subject => 'Blah blah')
|
21
|
+
temp = Signatory::Template.find('xxxyyy')
|
22
|
+
temp.subject.should == 'Blah blah'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe ".prepackage" do
|
27
|
+
it "should have roles and merge fields" do
|
28
|
+
temp = Signatory::Template.new(:guid => 'xxxyyy', :subject => 'Blah blah')
|
29
|
+
stub_prepackage('xxxyyy', 'yyyxxx')
|
30
|
+
packaged_temp = temp.prepackage
|
31
|
+
|
32
|
+
packaged_temp.roles.map(&:role).should include('Employer')
|
33
|
+
packaged_temp.merge_fields.map(&:name).should include('Company Name')
|
34
|
+
packaged_temp.id.should == 'yyyxxx'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe ".build_document" do
|
39
|
+
it "returns a new document" do
|
40
|
+
temp = Signatory::Template.new(:guid => 'xxxyyy', :subject => 'Blah blah')
|
41
|
+
doc_pkg = Signatory::Template.new(:guid => 'abcabc', :type => 'DocumentPackage')
|
42
|
+
doc = Signatory::Document.new
|
43
|
+
|
44
|
+
roles = [{:name => "Ryan Garver"}, {:name => "Cary Dunn"}]
|
45
|
+
merge_fields = {'Company Name' => 'ABC Corp'}
|
46
|
+
|
47
|
+
temp.should_receive(:prepackage).and_return(doc_pkg)
|
48
|
+
doc_pkg.should_receive(:prefill_and_send).with(merge_fields, roles).and_return(doc)
|
49
|
+
|
50
|
+
result = temp.build_document(merge_fields, roles)
|
51
|
+
result.should == doc
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context "type = DocumentPackage" do
|
56
|
+
describe ".signing_parties" do
|
57
|
+
it "returns all of the roles that must sign"
|
58
|
+
end
|
59
|
+
|
60
|
+
describe ".sender" do
|
61
|
+
it "returns the role who sent the document"
|
62
|
+
end
|
63
|
+
|
64
|
+
describe ".prefill_and_send" do
|
65
|
+
it "returns the sent document" do
|
66
|
+
doc_pkg = Signatory::Template.new(:guid => 'templid')
|
67
|
+
roles = [Signatory::Role.new(:name => "Ryan Garver", :role_name => 'Issuer'), Signatory::Role.new(:name => "Cary Dunn", :role_name => 'Investor')]
|
68
|
+
merge_fields = [Signatory::MergeField.new(:name => 'Company Name', :value => 'ABC Corp')]
|
69
|
+
|
70
|
+
id, subject = rand.to_s, "Subject #{rand}"
|
71
|
+
stub_template_send('templid', id, :roles => roles, :merge_fields => merge_fields)
|
72
|
+
stub_document(id, :subject => subject)
|
73
|
+
doc = doc_pkg.prefill_and_send(merge_fields, roles)
|
74
|
+
doc.guid.should == id
|
75
|
+
doc.subject.should == subject
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
metadata
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: signatory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryan Garver
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-02 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: bundler
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - "="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 1.0.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - "="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 62196431
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
- beta
|
51
|
+
- 22
|
52
|
+
version: 2.0.0.beta.22
|
53
|
+
type: :development
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - "="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 17
|
64
|
+
segments:
|
65
|
+
- 1
|
66
|
+
- 3
|
67
|
+
- 5
|
68
|
+
version: 1.3.5
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id003
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: bundler
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - "="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 23
|
80
|
+
segments:
|
81
|
+
- 1
|
82
|
+
- 0
|
83
|
+
- 0
|
84
|
+
version: 1.0.0
|
85
|
+
type: :runtime
|
86
|
+
version_requirements: *id004
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: oauth
|
89
|
+
prerelease: false
|
90
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - "="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 9
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
- 4
|
99
|
+
- 3
|
100
|
+
version: 0.4.3
|
101
|
+
type: :runtime
|
102
|
+
version_requirements: *id005
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: activeresource
|
105
|
+
prerelease: false
|
106
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 17
|
112
|
+
segments:
|
113
|
+
- 2
|
114
|
+
- 3
|
115
|
+
- 9
|
116
|
+
version: 2.3.9
|
117
|
+
type: :runtime
|
118
|
+
version_requirements: *id006
|
119
|
+
description: Signatory provides a simple wrapper around the RightSignature API.
|
120
|
+
email:
|
121
|
+
- ryan@profounder.com
|
122
|
+
executables: []
|
123
|
+
|
124
|
+
extensions: []
|
125
|
+
|
126
|
+
extra_rdoc_files: []
|
127
|
+
|
128
|
+
files:
|
129
|
+
- .gitignore
|
130
|
+
- .rvmrc
|
131
|
+
- Gemfile
|
132
|
+
- Gemfile.lock
|
133
|
+
- History.txt
|
134
|
+
- README.rdoc
|
135
|
+
- Rakefile
|
136
|
+
- lib/signatory.rb
|
137
|
+
- lib/signatory/api/base.rb
|
138
|
+
- lib/signatory/api/connection.rb
|
139
|
+
- lib/signatory/credentials.rb
|
140
|
+
- lib/signatory/document.rb
|
141
|
+
- lib/signatory/legacy_active_resource_hacks.rb
|
142
|
+
- lib/signatory/merge_field.rb
|
143
|
+
- lib/signatory/recipient.rb
|
144
|
+
- lib/signatory/role.rb
|
145
|
+
- lib/signatory/ruby_hacks.rb
|
146
|
+
- lib/signatory/template.rb
|
147
|
+
- lib/signatory/version.rb
|
148
|
+
- signatory.gemspec
|
149
|
+
- spec/credentials_spec.rb
|
150
|
+
- spec/document_spec.rb
|
151
|
+
- spec/fixtures/document.xml.erb
|
152
|
+
- spec/fixtures/documents.xml.erb
|
153
|
+
- spec/fixtures/template.xml.erb
|
154
|
+
- spec/fixtures/template_prepackage.xml.erb
|
155
|
+
- spec/fixtures/template_sent.xml.erb
|
156
|
+
- spec/fixtures/templates.xml.erb
|
157
|
+
- spec/helpers/right_signature_stub.rb
|
158
|
+
- spec/merge_field_spec.rb
|
159
|
+
- spec/recipient_spec.rb
|
160
|
+
- spec/role_spec.rb
|
161
|
+
- spec/signatory_spec.rb
|
162
|
+
- spec/spec_helper.rb
|
163
|
+
- spec/template_spec.rb
|
164
|
+
has_rdoc: true
|
165
|
+
homepage: http://rubygems.org/gems/signatory
|
166
|
+
licenses: []
|
167
|
+
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
none: false
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
179
|
+
segments:
|
180
|
+
- 0
|
181
|
+
version: "0"
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
hash: 23
|
188
|
+
segments:
|
189
|
+
- 1
|
190
|
+
- 3
|
191
|
+
- 6
|
192
|
+
version: 1.3.6
|
193
|
+
requirements: []
|
194
|
+
|
195
|
+
rubyforge_project: signatory
|
196
|
+
rubygems_version: 1.3.7
|
197
|
+
signing_key:
|
198
|
+
specification_version: 3
|
199
|
+
summary: API wrapper for RightSignature
|
200
|
+
test_files: []
|
201
|
+
|