synapsis 0.0.12 → 0.0.13

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: c4dba020d1db06c8514fcbd98c992fe177f30965
4
- data.tar.gz: ae4bdaececc8d77fd3d9f8356d9b3c8f08f7f5ff
3
+ metadata.gz: d94953c2e95d8ea5a35b87f4c805322e5b5f3c33
4
+ data.tar.gz: ec942a1edce3b84fadf2a9b7face1e78a63ff06b
5
5
  SHA512:
6
- metadata.gz: b095652236ee088bd5828fee5113638347ee053863962a932c5be0c5233ffe333787e65d78a1dda9df54bf20327d64a3572bd433dbd54cb8aa4b44413beeb369
7
- data.tar.gz: 825c6e99316e02f09c84b46f8f9eb3a36c9335b8c497d262f29793e11d66cf5b9bdcb929b9a304d4e6788137fcea3637b2021a9621e35849df77bc42746134ac
6
+ metadata.gz: ed8157377a3b594dfbf34290895955cb33d6b4fd6366da9dc385db9b5b978390a1449648050f90fbf60264e97edc680e3843e6bc51d8470bbca6cac239abedbd
7
+ data.tar.gz: 6129e7883fda49d6cda320e3e13fc5cce947821820a1109541b6931c0be10f5732c28a3947b65ee7a1a25c84174815d4f72e0731d3b7430c088ddc5bf534fa4f
@@ -34,7 +34,7 @@ class Synapsis::User < Synapsis::APIResource
34
34
  end
35
35
  end
36
36
 
37
- def self.verify(params)
37
+ def self.verify_ssn(params)
38
38
  response = request(:post, verify_ssn_url, params)
39
39
 
40
40
  # Synapse incorrectly returns SSN validation fails as 200. Thus we have to override default return_reponse behavior
@@ -1,3 +1,3 @@
1
1
  module Synapsis
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -94,7 +94,7 @@ RSpec.describe Synapsis::Bank do
94
94
 
95
95
  new_bank = Synapsis::Bank.link(bank_params)
96
96
 
97
- expect(new_bank.banks.first.name_on_account).to eq user_params[:fullname]
97
+ expect(new_bank.banks.first.name_on_account).to eq 'Test User' # Synapse returns Test User
98
98
  expect(new_bank.banks.first.bank_name).to eq bank_params[:bank]
99
99
  end
100
100
 
@@ -160,7 +160,7 @@ RSpec.describe Synapsis::Bank do
160
160
  new_bank = Synapsis::Bank.link(bank_params)
161
161
 
162
162
  # Upcase since Synapse automatically downcases titles such as "MD, PHD" (it becomes Md or Phd)
163
- expect(new_bank.banks.first.name_on_account.upcase).to eq user_params[:fullname].upcase
163
+ expect(new_bank.banks.first.name_on_account.upcase).to eq 'TEST USER'
164
164
  expect(new_bank.banks.first.bank_name).to eq bank_params[:bank]
165
165
  end
166
166
  end
@@ -95,7 +95,7 @@ RSpec.describe Synapsis::User do
95
95
  }}
96
96
 
97
97
  context 'happy path' do
98
- it 'SSN validations fails: return a Synapsis error' do
98
+ it 'returns success: true' do
99
99
  new_synapse_user = create_user
100
100
 
101
101
  SYNAPSE_SANDBOX_SSN_VALIDATION_SUCCEEDS_VALUE = '0000'
@@ -130,18 +130,35 @@ RSpec.describe Synapsis::User do
130
130
  end
131
131
  end
132
132
 
133
- context 'verify ssn' do
134
- xit 'need to consult with synapse re: verify SSN intended results' do
135
- new_synapse_user = create_user
133
+ context '.verify_ssn' do
134
+ context 'happy path' do
135
+ it 'returns success: true' do
136
+ new_synapse_user = create_user
136
137
 
137
- SYNAPSE_SANDBOX_SSN_VALIDATION_NEEDS_TO_BE_VERIFIED_VALUE = '3333'
138
+ SYNAPSE_SANDBOX_SSN_VALIDATION_NEEDS_TO_BE_VERIFIED_VALUE = '3333'
138
139
 
139
- ssn_validation_succeeds_params = ssn_information.merge(oauth_consumer_key: new_synapse_user.oauth_consumer_key, ssn: SYNAPSE_SANDBOX_SSN_VALIDATION_NEEDS_TO_BE_VERIFIED_VALUE)
140
+ ssn_validation_succeeds_params = ssn_information.merge(oauth_consumer_key: new_synapse_user.oauth_consumer_key, ssn: SYNAPSE_SANDBOX_SSN_VALIDATION_NEEDS_TO_BE_VERIFIED_VALUE)
140
141
 
141
- successful_add_ssn_response = Synapsis::User.add_ssn(ssn_validation_succeeds_params)
142
+ verifiable_ssn_response = Synapsis::User.add_ssn(ssn_validation_succeeds_params)
142
143
 
143
- expect(successful_add_ssn_response.success).to eq true
144
+ verify_ssn_params = {
145
+ oauth_consumer_key: new_synapse_user.oauth_consumer_key,
146
+ questions: [
147
+ { question_id: 1, answer_id: 9},
148
+ { question_id: 2, answer_id: 2},
149
+ { question_id: 3, answer_id: 3},
150
+ { question_id: 4, answer_id: 4},
151
+ { question_id: 5, answer_id: 5}
152
+ ],
153
+ id: verifiable_ssn_response.question_set.id
154
+ }
155
+
156
+ successful_add_ssn_response = Synapsis::User.verify_ssn(verify_ssn_params)
157
+
158
+ expect(successful_add_ssn_response.success).to eq true
159
+ end
144
160
  end
161
+
145
162
  end
146
163
  end
147
164
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapsis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daryll Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday