synapsis 0.0.12 → 0.0.13
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.
- checksums.yaml +4 -4
- data/lib/synapsis/user.rb +1 -1
- data/lib/synapsis/version.rb +1 -1
- data/spec/synapsis/bank_link_spec.rb +2 -2
- data/spec/synapsis/user_spec.rb +25 -8
- 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: d94953c2e95d8ea5a35b87f4c805322e5b5f3c33
         | 
| 4 | 
            +
              data.tar.gz: ec942a1edce3b84fadf2a9b7face1e78a63ff06b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ed8157377a3b594dfbf34290895955cb33d6b4fd6366da9dc385db9b5b978390a1449648050f90fbf60264e97edc680e3843e6bc51d8470bbca6cac239abedbd
         | 
| 7 | 
            +
              data.tar.gz: 6129e7883fda49d6cda320e3e13fc5cce947821820a1109541b6931c0be10f5732c28a3947b65ee7a1a25c84174815d4f72e0731d3b7430c088ddc5bf534fa4f
         | 
    
        data/lib/synapsis/user.rb
    CHANGED
    
    | @@ -34,7 +34,7 @@ class Synapsis::User < Synapsis::APIResource | |
| 34 34 | 
             
                end
         | 
| 35 35 | 
             
              end
         | 
| 36 36 |  | 
| 37 | 
            -
              def self. | 
| 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
         | 
    
        data/lib/synapsis/version.rb
    CHANGED
    
    
| @@ -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  | 
| 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  | 
| 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
         | 
    
        data/spec/synapsis/user_spec.rb
    CHANGED
    
    | @@ -95,7 +95,7 @@ RSpec.describe Synapsis::User do | |
| 95 95 | 
             
                }}
         | 
| 96 96 |  | 
| 97 97 | 
             
                context 'happy path' do
         | 
| 98 | 
            -
                  it ' | 
| 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 ' | 
| 134 | 
            -
                   | 
| 135 | 
            -
                     | 
| 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 | 
            -
             | 
| 138 | 
            +
                      SYNAPSE_SANDBOX_SSN_VALIDATION_NEEDS_TO_BE_VERIFIED_VALUE = '3333'
         | 
| 138 139 |  | 
| 139 | 
            -
             | 
| 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 | 
            -
             | 
| 142 | 
            +
                      verifiable_ssn_response = Synapsis::User.add_ssn(ssn_validation_succeeds_params)
         | 
| 142 143 |  | 
| 143 | 
            -
             | 
| 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. | 
| 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- | 
| 11 | 
            +
            date: 2015-07-21 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: faraday
         |