├── .document ├── .gitignore ├── .hound.yml ├── .rspec ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── blockscore.gemspec ├── circle.yml ├── circleci.sh ├── config ├── devtools.yml ├── flay.yml ├── flog.yml ├── mutant.yml ├── reek.yml ├── rubocop.yml └── yardstick.yml ├── contributing.json ├── example.env ├── lib ├── blockscore.rb └── blockscore │ ├── actions │ ├── all.rb │ ├── create.rb │ ├── delete.rb │ ├── retrieve.rb │ ├── update.rb │ └── write_once.rb │ ├── base.rb │ ├── candidate.rb │ ├── collection.rb │ ├── collection │ └── member.rb │ ├── company.rb │ ├── connection.rb │ ├── dispatch.rb │ ├── errors │ ├── api_connection_error.rb │ ├── api_error.rb │ ├── authentication_error.rb │ ├── error.rb │ ├── invalid_request_error.rb │ ├── no_api_key_error.rb │ └── not_found_error.rb │ ├── fingerprint.rb │ ├── person.rb │ ├── question_set.rb │ ├── response.rb │ ├── util.rb │ ├── version.rb │ └── watchlist_hit.rb └── spec ├── cassettes ├── BlockScore_Actions_All │ └── _all │ │ ├── 1_1_1.yml │ │ ├── 1_1_2.yml │ │ ├── 1_1_3.yml │ │ ├── invalid_comparison_operator │ │ └── returns_an_error_if_comparison_operator_not_in_allowed_list.yml │ │ └── invalid_filter_parameter │ │ └── returns_an_error_if_filter_parameter_not_in_list.yml ├── BlockScore_Actions_Create │ └── _create │ │ ├── 1_1_1.yml │ │ └── 1_1_2.yml ├── BlockScore_Actions_Delete │ ├── _delete │ │ ├── deleted_ │ │ │ └── 1_1_2_1.yml │ │ ├── persisted_ │ │ │ └── 1_1_1_1.yml │ │ └── previously_deleted │ │ │ └── was_already_deleted.yml │ └── _delete_ │ │ ├── 1_3_1.yml │ │ ├── deleted_ │ │ └── 1_2_2_1.yml │ │ ├── persisted_ │ │ └── 1_2_1_1.yml │ │ └── previously_deleted │ │ └── was_already_deleted.yml ├── BlockScore_Actions_Retrieve │ └── _retrieve │ │ ├── 1_1_1.yml │ │ ├── 1_1_3.yml │ │ └── name_first │ │ └── 1_1_2_1.yml ├── BlockScore_Actions_Update │ └── _save_ │ │ └── when_changing_first_update_candidate │ │ └── has_the_same_attributes.yml ├── BlockScore_Actions_WriteOnce │ ├── _save_ │ │ ├── when_creating_a_new_person │ │ │ ├── 1_1_1_1.yml │ │ │ └── name_first │ │ │ │ └── 1_1_1_2_1.yml │ │ └── when_updating_an_existing_person │ │ │ └── prevents_saving.yml │ └── object_is_immutable │ │ └── prevents_alteration.yml ├── BlockScore_Base │ ├── _attributes │ │ ├── name_first │ │ │ └── 1_4_1_1.yml │ │ └── retrieves_the_attributes.yml │ ├── _capture_attributes │ │ └── captures_the_attributes_from_a_http_response.yml │ ├── _deleted_ │ │ └── reflects_deleted_.yml │ ├── _id │ │ └── id │ │ │ └── 1_7_1_1.yml │ ├── _initialize │ │ ├── loads_the_block.yml │ │ └── name_first │ │ │ └── 1_5_1_1.yml │ ├── _inspect │ │ ├── 1_9_1.yml │ │ └── 1_9_2.yml │ ├── _save │ │ ├── when_creating_a_new_candidate │ │ │ ├── name_first │ │ │ │ └── 1_1_1_2_1.yml │ │ │ └── persisted_ │ │ │ │ └── 1_1_1_1_1.yml │ │ ├── when_encountering_a_deleted_item │ │ │ └── is_false_when_previously_deleted.yml │ │ └── when_updating_an_existing_candidate │ │ │ ├── name_first │ │ │ └── 1_1_2_2_1.yml │ │ │ └── persisted_ │ │ │ └── 1_1_2_1_1.yml │ ├── _save_ │ │ ├── when_encountering_a_deleted_item │ │ │ └── raises_an_error_when_previously_deleted.yml │ │ └── when_updating_an_new_candidate │ │ │ └── successfully_saves_an_alteration.yml │ └── _wrap_hash │ │ └── details │ │ └── 1_8_1_1.yml ├── BlockScore_Candidate │ ├── _create │ │ ├── 1_2_2.yml │ │ └── persisted_ │ │ │ └── 1_2_1_1.yml │ ├── _history │ │ ├── 1_4_1.yml │ │ ├── 1_4_2.yml │ │ ├── 1_4_3.yml │ │ └── 1_4_4.yml │ ├── _hits │ │ ├── hits │ │ │ └── 1_5_1_1.yml │ │ └── returns_a_watchlist_hit.yml │ ├── _save │ │ └── when_iteratively_updating_an_existing_candidate │ │ │ ├── name_first │ │ │ └── 1_3_1_2_1.yml │ │ │ ├── name_middle │ │ │ └── 1_3_1_3_1.yml │ │ │ └── persisted_ │ │ │ └── 1_3_1_1_1.yml │ └── _search │ │ ├── 1_6_1.yml │ │ ├── 1_6_2.yml │ │ ├── cannot_search_on_unsaved_candidate │ │ └── is_an_invalid_request.yml │ │ ├── has_a_good_confidence.yml │ │ ├── proof_of_similarity_filtering │ │ └── 1_6_8_1.yml │ │ ├── proof_of_similarity_filtering_rejected_and_accepted_ │ │ └── 1_6_9_1.yml │ │ ├── proof_of_similarity_filtering_with_match_on_company │ │ └── 1_6_10_1.yml │ │ ├── search_by_company │ │ └── 1_6_5_1.yml │ │ ├── search_empty_candidate_with_similarity │ │ └── 1_6_7_1.yml │ │ └── search_with_similarity │ │ ├── 1_6_6_1.yml │ │ ├── 1_6_6_2.yml │ │ └── has_a_good_confidence.yml ├── BlockScore_Collection │ ├── 1_1.yml │ ├── 1_2.yml │ ├── _all │ │ ├── 1_3_1.yml │ │ └── 1_3_2.yml │ ├── _create │ │ ├── 1_6_1.yml │ │ ├── 1_6_3.yml │ │ └── count │ │ │ └── 1_6_2_1.yml │ ├── _new │ │ ├── 1_4_1.yml │ │ ├── 1_4_3.yml │ │ └── count │ │ │ └── 1_4_2_1.yml │ ├── _refresh │ │ ├── 1_5_1.yml │ │ └── 1_5_2.yml │ └── _retrieve │ │ └── is_the_proper_class.yml ├── BlockScore_Collection_Member │ └── _save │ │ ├── previously_saved_person │ │ └── contains_the_proper_fields.yml │ │ └── unsaved_person │ │ └── saves_the_person_as_part_of_member_save.yml ├── BlockScore_Company │ └── _create │ │ ├── invalid_company │ │ ├── 1_2_2_1.yml │ │ └── 1_2_2_2.yml │ │ └── valid_company │ │ ├── 1_2_1_1.yml │ │ └── 1_2_1_2.yml ├── BlockScore_InvalidRequestError │ └── behaves_like_an_error │ │ └── 1_1_1.yml ├── BlockScore_NotFoundError │ └── behaves_like_an_error │ │ └── 1_1_1.yml ├── BlockScore_Person │ ├── _create │ │ ├── invalid_person │ │ │ ├── 1_2_2_1.yml │ │ │ └── 1_2_2_2.yml │ │ └── valid_person │ │ │ ├── 1_2_1_1.yml │ │ │ └── 1_2_1_2.yml │ ├── _invalid_ │ │ ├── invalid_person │ │ │ ├── 1_4_2_1.yml │ │ │ ├── 1_4_2_2.yml │ │ │ └── 1_4_2_3.yml │ │ └── valid_person │ │ │ ├── 1_4_1_1.yml │ │ │ ├── 1_4_1_2.yml │ │ │ └── 1_4_1_3.yml │ └── _valid_ │ │ ├── invalid_person │ │ ├── 1_3_2_1.yml │ │ ├── 1_3_2_2.yml │ │ └── 1_3_2_3.yml │ │ └── valid_person │ │ ├── 1_3_1_1.yml │ │ ├── 1_3_1_2.yml │ │ └── 1_3_1_3.yml └── BlockScore_QuestionSet │ ├── _create │ ├── invalid_person │ │ └── is_an_invalid_request.yml │ └── valid_person │ │ ├── 1_2_1_1.yml │ │ └── 1_2_1_2.yml │ └── _score │ ├── correct_answers │ └── 1_3_1_1.yml │ ├── incorrect_answers │ └── 1_3_2_1.yml │ ├── malformed_answers │ └── raises_an_error_when_answers_are_not_an_array_of_hashes.yml │ ├── previous_answers │ └── 1_3_4_1.yml │ └── previously_no_answers │ └── 1_3_5_1.yml ├── factories ├── candidates.rb ├── companies.rb ├── people.rb └── question_sets.rb ├── spec.rb ├── spec_helper.rb ├── support ├── api_request_behavior.rb ├── error_behavior.rb ├── included_class_methods.rb ├── question_set_helper.rb └── vcr_helper.rb ├── unit └── block_score │ ├── actions │ ├── all_spec.rb │ ├── create_spec.rb │ ├── delete_spec.rb │ ├── retrieve_spec.rb │ ├── update_spec.rb │ └── write_once_spec.rb │ ├── api_connection_error_spec.rb │ ├── base_spec.rb │ ├── candidate_spec.rb │ ├── collection │ └── member_spec.rb │ ├── collection_spec.rb │ ├── company_spec.rb │ ├── connection_spec.rb │ ├── invalid_request_error_spec.rb │ ├── not_found_error_spec.rb │ ├── person_spec.rb │ ├── question_set_spec.rb │ └── util_spec.rb └── vcr_setup.rb /.document: -------------------------------------------------------------------------------- 1 | lib/**/*.rb 2 | bin/* 3 | - 4 | features/**/*.feature 5 | LICENSE.txt 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # rcov generated 2 | coverage 3 | coverage.data 4 | 5 | # rdoc generated 6 | rdoc 7 | 8 | # yard generated 9 | doc 10 | .yardoc 11 | 12 | # bundler 13 | .bundle 14 | 15 | # jeweler generated 16 | pkg 17 | 18 | # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore: 19 | # 20 | # * Create a file at ~/.gitignore 21 | # * Include files you want ignored 22 | # * Run: git config --global core.excludesfile ~/.gitignore 23 | # 24 | # After doing this, these files will be ignored in all your git projects, 25 | # saving you from having to 'pollute' every project you touch with them 26 | # 27 | # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line) 28 | # 29 | # For MacOS: 30 | # 31 | #.DS_Store 32 | 33 | # For TextMate 34 | #*.tmproj 35 | #tmtags 36 | 37 | # For emacs: 38 | #*~ 39 | #\#* 40 | #.\#* 41 | 42 | # For vim: 43 | *.sw[op] 44 | 45 | # For redcar: 46 | #.redcar 47 | 48 | # For rubinius: 49 | #*.rbc 50 | 51 | *.sublime-workspace 52 | *.sublime-project 53 | 54 | *.DS_Store 55 | 56 | blockscore-*.gem 57 | 58 | Gemfile.lock 59 | 60 | spec/.rspec-state 61 | 62 | .env 63 | .ruby-version 64 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | .rubocop.yml -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format Fuubar 2 | --color 3 | -Ilib 4 | -r spec 5 | -r spec_helper 6 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | group :test do 6 | platform :mri_22 do 7 | gem 'devtools', '~> 0.1.5' 8 | end 9 | 10 | # API Request Faking 11 | gem 'dotenv' 12 | gem 'vcr' 13 | gem 'webmock' 14 | gem 'fuubar' 15 | gem 'codeclimate-test-reporter' 16 | gem 'rubocop-rspec' 17 | end 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2015 BlockScore 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # blockscore-ruby 2 | 3 | [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/BlockScore/blockscore-ruby/blob/master/LICENSE) 4 | [![Circle CI](https://img.shields.io/circleci/project/BlockScore/blockscore-ruby/master.svg?style=flat-square)](https://circleci.com/gh/BlockScore/blockscore-ruby) 5 | [![Code Climate](https://img.shields.io/codeclimate/github/BlockScore/blockscore-ruby.svg?style=flat-square)](https://codeclimate.com/github/BlockScore/blockscore-ruby) 6 | [![Test Coverage](https://img.shields.io/codeclimate/coverage/github/BlockScore/blockscore-ruby.svg?style=flat-square)](https://codeclimate.com/github/BlockScore/blockscore-ruby/coverage) 7 | [![Dependency Status](https://img.shields.io/gemnasium/BlockScore/blockscore-ruby.svg?style=flat-square)](https://gemnasium.com/BlockScore/blockscore-ruby) 8 | 9 | This is the official library for Ruby clients of the BlockScore API. [Click here to read the full documentation including code examples](http://docs.blockscore.com/ruby/). 10 | 11 | ## Install 12 | 13 | Via rubygems.org: 14 | 15 | ```ruby 16 | gem install blockscore 17 | ``` 18 | 19 | If you are using Rails, add the following to your `Gemfile`: 20 | 21 | ```ruby 22 | gem 'blockscore', '~> 4.2.1' 23 | ``` 24 | 25 | ## Getting Started 26 | 27 | To get started, you can initialize the library with one line: 28 | 29 | ```ruby 30 | BlockScore.api_key = 'your-api-key' 31 | ``` 32 | 33 | To verify a person: 34 | 35 | ```ruby 36 | person = BlockScore::Person.create( 37 | birth_day: '23', 38 | birth_month: '8', 39 | birth_year: '1980', 40 | document_type: 'ssn', 41 | document_value: '0000', 42 | name_first: 'John', 43 | name_middle: 'Pearce', 44 | name_last: 'Doe', 45 | address_street1: '1 Infinite Loop', 46 | address_street2: 'Apt 6', 47 | address_city: 'Cupertino', 48 | address_subdivision: 'CA', 49 | address_postal_code: '95014', 50 | address_country_code: 'US' 51 | ) 52 | 53 | # Check the validation status of the Person 54 | person.status 55 | # => 'valid' 56 | 57 | # Or view some of the other attributes 58 | person.details.address 59 | # => 'mismatch' 60 | ``` 61 | 62 | To see the list of calls you can make, please visit our [full Ruby API reference](http://docs.blockscore.com/ruby/). 63 | 64 | ## Testing 65 | 66 | In order to run the test suite: 67 | 68 | ```shell 69 | $ rspec 70 | ``` 71 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require 'rubygems' 4 | require 'bundler' 5 | begin 6 | Bundler.setup(:default, :development) 7 | rescue Bundler::BundlerError => e 8 | $stderr.puts e.message 9 | $stderr.puts 'Run `bundle install` to install missing gems' 10 | exit e.status_code 11 | end 12 | require 'rake' 13 | require 'devtools' 14 | 15 | Devtools.init_rake_tasks 16 | 17 | require 'rake/testtask' 18 | Rake::TestTask.new(:test) do |test| 19 | test.libs << 'lib' << 'test' 20 | test.pattern = 'test/blockscore/*_test.rb' 21 | test.verbose = true 22 | end 23 | 24 | desc 'Code coverage detail' 25 | task :simplecov do 26 | ENV['COVERAGE'] = 'true' 27 | Rake::Task['test'].execute 28 | end 29 | 30 | task default: :test 31 | 32 | require 'rdoc/task' 33 | Rake::RDocTask.new do |rdoc| 34 | version = File.exist?('VERSION') ? File.read('VERSION') : '' 35 | 36 | rdoc.rdoc_dir = 'rdoc' 37 | rdoc.title = "blockscore #{version}" 38 | rdoc.rdoc_files.include('README*') 39 | rdoc.rdoc_files.include('lib/**/*.rb') 40 | end 41 | 42 | task('metrics:mutant').clear 43 | 44 | namespace :metrics do 45 | config = Devtools.project.mutant 46 | 47 | desc 'Measure mutation coverage' 48 | task mutant: :coverage do 49 | require 'mutant' 50 | 51 | arguments = %W( 52 | --jobs 1 53 | --use #{config.strategy} 54 | --since #{config.since} 55 | --include lib 56 | --expect-coverage #{config.expect_coverage} 57 | -- 58 | ).concat(Array(config.namespace).map { |namespace| "#{namespace}*" }) 59 | 60 | unless Mutant::CLI.run(arguments) 61 | Devtools.notify_metric_violation('Mutant task is not successful') 62 | end 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /blockscore.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | 5 | require 'blockscore/version' 6 | 7 | Gem::Specification.new do |spec| 8 | spec.name = 'blockscore' 9 | spec.version = BlockScore::VERSION 10 | spec.authors = ['Alain Meier', 'John Backus', 'Connor Jacobsen'] 11 | spec.email = ['alain@blockscore.com', 'john@blockscore.com'] 12 | 13 | spec.summary = 'A ruby client library for the BlockScore API.' 14 | spec.description = 'BlockScore makes ID verification easier and faster. See https://blockscore.com for more.' 15 | spec.homepage = 'https://blockscore.com' 16 | spec.license = 'MIT' 17 | 18 | spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 19 | spec.bindir = 'exe' 20 | spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 21 | spec.require_paths = ['lib'] 22 | 23 | spec.required_ruby_version = '>= 1.9.3' 24 | 25 | spec.add_dependency 'httparty', '~> 0.11' 26 | 27 | spec.add_development_dependency 'rdoc', '~> 3.12' 28 | spec.add_development_dependency 'rake', '~> 12.3' 29 | spec.add_development_dependency 'bundler', '~> 1.0' 30 | spec.add_development_dependency 'simplecov', '~> 0' 31 | spec.add_development_dependency 'rspec', '~> 3' 32 | spec.add_development_dependency 'rspec-its', '~> 1' 33 | spec.add_development_dependency 'webmock', '~> 1.21' 34 | spec.add_development_dependency 'faker', '~> 1.4' 35 | spec.add_development_dependency 'factory_girl', '~> 4.5' 36 | end 37 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | override: 3 | - ./circleci.sh build 4 | test: 5 | override: 6 | - ./circleci.sh spec: 7 | parallel: true 8 | -------------------------------------------------------------------------------- /circleci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | RUBY_VERSIONS=(2.0.0-p648 2.1.8 2.2.4) 3 | CIRCLE_NODE_RUBY_VERSION="${RUBY_VERSIONS[$CIRCLE_NODE_INDEX]}" 4 | NUM_RUBIES=${#RUBY_VERSIONS[@]} 5 | METRICS_BUILD_RUBY_VERSION="2.2.4" 6 | 7 | if [ "$CIRCLE_NODE_TOTAL" -le "$NUM_RUBIES" ]; then 8 | echo "Cannot test $NUM_RUBIES ruby versions and metrics on $CIRCLE_NODE_TOTAL containers" 9 | exit 1 10 | fi 11 | 12 | # Exit early if there are more containers than ruby versions to test 13 | if [ "$CIRCLE_NODE_INDEX" -gt "$NUM_RUBIES" ]; then 14 | echo "Ignoring extra container" 15 | exit 0 16 | fi 17 | 18 | # Determine current build type (metrics or tests) 19 | if [ "$CIRCLE_NODE_INDEX" -eq $((CIRCLE_NODE_TOTAL-1)) ]; then 20 | BUILD="metrics" 21 | CIRCLE_NODE_RUBY_VERSION=$METRICS_BUILD_RUBY_VERSION 22 | else 23 | BUILD="tests" 24 | fi 25 | 26 | if [[ "$1" = "build" ]]; then 27 | rvm-exec $CIRCLE_NODE_RUBY_VERSION bundle install; 28 | elif [[ "$1" = "spec" && "$BUILD" = "tests" ]]; then 29 | rvm-exec $CIRCLE_NODE_RUBY_VERSION rspec; 30 | elif [[ "$1" = "spec" && "$BUILD" = "metrics" ]]; then 31 | rvm-exec $CIRCLE_NODE_RUBY_VERSION bundle exec rake metrics:mutant metrics:rubocop; 32 | fi 33 | -------------------------------------------------------------------------------- /config/devtools.yml: -------------------------------------------------------------------------------- 1 | --- 2 | unit_test_timeout: 3.0 3 | -------------------------------------------------------------------------------- /config/flay.yml: -------------------------------------------------------------------------------- 1 | --- 2 | threshold: 16 3 | total_score: 187 4 | -------------------------------------------------------------------------------- /config/flog.yml: -------------------------------------------------------------------------------- 1 | --- 2 | threshold: 28.8 3 | -------------------------------------------------------------------------------- /config/mutant.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: blockscore 3 | namespace: BlockScore 4 | expect_coverage: 1/1 5 | ignore_subjects: [] 6 | since: HEAD~1 7 | -------------------------------------------------------------------------------- /config/reek.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Attribute: 3 | enabled: false 4 | exclude: [] 5 | BooleanParameter: 6 | enabled: true 7 | exclude: [] 8 | ClassVariable: 9 | enabled: true 10 | exclude: [] 11 | ControlParameter: 12 | enabled: true 13 | exclude: [] 14 | DataClump: 15 | enabled: true 16 | exclude: [] 17 | max_copies: 2 18 | min_clump_size: 2 19 | DuplicateMethodCall: 20 | enabled: false 21 | exclude: [] 22 | max_calls: 1 23 | allow_calls: [] 24 | FeatureEnvy: 25 | enabled: true 26 | exclude: [] 27 | IrresponsibleModule: 28 | enabled: false 29 | exclude: [] 30 | LongParameterList: 31 | enabled: true 32 | exclude: [] 33 | max_params: 3 34 | overrides: 35 | initialize: 36 | max_params: 5 37 | LongYieldList: 38 | enabled: true 39 | exclude: [] 40 | max_params: 3 41 | ModuleInitialize: 42 | enabled: true 43 | exclude: [] 44 | NestedIterators: 45 | enabled: true 46 | exclude: [] 47 | max_allowed_nesting: 2 48 | ignore_iterators: [] 49 | NilCheck: 50 | enabled: true 51 | exclude: [] 52 | PrimaDonnaMethod: 53 | enabled: true 54 | exclude: [] 55 | RepeatedConditional: 56 | enabled: true 57 | exclude: [] 58 | max_ifs: 2 59 | TooManyInstanceVariables: 60 | enabled: true 61 | exclude: [] 62 | max_instance_variables: 9 63 | TooManyMethods: 64 | enabled: true 65 | exclude: [] 66 | max_methods: 25 67 | TooManyStatements: 68 | enabled: true 69 | exclude: 70 | - initialize 71 | max_statements: 5 72 | UncommunicativeMethodName: 73 | enabled: true 74 | exclude: [] 75 | reject: 76 | - !ruby/regexp /^[a-z]$/ 77 | - !ruby/regexp /[0-9]$/ 78 | - !ruby/regexp /[A-Z]/ 79 | accept: [] 80 | UncommunicativeModuleName: 81 | enabled: true 82 | exclude: [] 83 | reject: 84 | - !ruby/regexp /^.$/ 85 | - !ruby/regexp /[0-9]$/ 86 | accept: 87 | - Inline::C 88 | UncommunicativeParameterName: 89 | enabled: true 90 | exclude: [] 91 | reject: 92 | - !ruby/regexp /^.$/ 93 | - !ruby/regexp /[0-9]$/ 94 | - !ruby/regexp /[A-Z]/ 95 | - !ruby/regexp /^_/ 96 | accept: [] 97 | UncommunicativeVariableName: 98 | enabled: true 99 | exclude: [] 100 | reject: 101 | - !ruby/regexp /^.$/ 102 | - !ruby/regexp /[0-9]$/ 103 | - !ruby/regexp /[A-Z]/ 104 | accept: 105 | - _ 106 | UnusedParameters: 107 | enabled: true 108 | exclude: [] 109 | UtilityFunction: 110 | enabled: true 111 | exclude: [] 112 | -------------------------------------------------------------------------------- /config/yardstick.yml: -------------------------------------------------------------------------------- 1 | --- 2 | threshold: 100 3 | -------------------------------------------------------------------------------- /contributing.json: -------------------------------------------------------------------------------- 1 | { 2 | "commit": { 3 | "subject_cannot_be_empty": true, 4 | "subject_must_be_longer_than": 4, 5 | "subject_must_be_shorter_than": 101, 6 | "subject_lines_must_be_shorter_than": 51, 7 | "subject_must_be_single_line": true, 8 | "subject_must_be_in_tense": "imperative", 9 | "subject_must_start_with_case": "upper", 10 | "subject_must_not_end_with_dot": true, 11 | "body_lines_must_be_shorter_than": 73 12 | }, 13 | "pull_request": { 14 | "subject_cannot_be_empty": true, 15 | "subject_must_be_longer_than": 4, 16 | "subject_must_be_shorter_than": 101, 17 | "subject_must_be_in_tense": "imperative", 18 | "subject_must_start_with_case": "upper", 19 | "subject_must_not_end_with_dot": true, 20 | "body_cannot_be_empty": true, 21 | "body_must_include_verification_steps": false 22 | }, 23 | "issue": { 24 | "subject_cannot_be_empty": true, 25 | "subject_must_be_longer_than": 4, 26 | "subject_must_be_shorter_than": 101, 27 | "subject_must_be_in_tense": "imperative", 28 | "subject_must_start_with_case": "upper", 29 | "subject_must_not_end_with_dot": true, 30 | "body_cannot_be_empty": true, 31 | "body_must_include_reproduction_steps": false 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example.env: -------------------------------------------------------------------------------- 1 | # https://manage.blockscore.com/api_keys 2 | export BLOCKSCORE_TEST_KEY= 3 | -------------------------------------------------------------------------------- /lib/blockscore.rb: -------------------------------------------------------------------------------- 1 | require 'delegate' 2 | require 'forwardable' 3 | require 'httparty' 4 | require 'json' 5 | require 'ostruct' 6 | require 'uri' 7 | 8 | require 'blockscore/actions/all' 9 | require 'blockscore/actions/create' 10 | require 'blockscore/actions/delete' 11 | require 'blockscore/actions/retrieve' 12 | require 'blockscore/actions/update' 13 | require 'blockscore/actions/write_once' 14 | 15 | require 'blockscore/errors/api_connection_error' 16 | require 'blockscore/errors/api_error' 17 | require 'blockscore/errors/authentication_error' 18 | require 'blockscore/errors/error' 19 | require 'blockscore/errors/invalid_request_error' 20 | require 'blockscore/errors/no_api_key_error' 21 | require 'blockscore/errors/not_found_error' 22 | 23 | require 'blockscore/version' 24 | 25 | require 'blockscore/base' 26 | require 'blockscore/candidate' 27 | require 'blockscore/company' 28 | require 'blockscore/person' 29 | require 'blockscore/question_set' 30 | require 'blockscore/watchlist_hit' 31 | 32 | require 'blockscore/collection' 33 | require 'blockscore/collection/member' 34 | require 'blockscore/connection' 35 | require 'blockscore/dispatch' 36 | require 'blockscore/fingerprint' 37 | require 'blockscore/response' 38 | require 'blockscore/util' 39 | 40 | module BlockScore 41 | class << self 42 | attr_accessor :api_key 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /lib/blockscore/actions/all.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Actions 3 | # Public: Provides an :all action to including Classes. 4 | # 5 | # The :all method returns up to 25 items from the BlockScore API for 6 | # the given class. 7 | # 8 | # :all accepts an options hash, which responds to the following options: 9 | # 10 | # count - Fixnum number of items to return per page. 11 | # offset - Fixnum number of items to skip before returning @count items. 12 | # 13 | # If no count is provided, 25 items are returned, or all items if the total 14 | # number of items is 25 of fewer. 15 | module All 16 | module ClassMethods 17 | def all(options = {}) 18 | get(endpoint, options) 19 | end 20 | end 21 | 22 | def self.included(base) 23 | base.extend(ClassMethods) 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/blockscore/actions/create.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Actions 3 | # Public: Provides a :create class method which creates a new instance 4 | # of the desired class using the BlockScore API. 5 | # 6 | # Examples 7 | # 8 | # candidate = BlockScore::Candidate.create( 9 | # note: "12341234", 10 | # ssn: "0001", 11 | # date_of_birth: "1940-08-11", 12 | # name_first: "John", 13 | # name_middle: "", 14 | # name_last: "Bredenkamp", 15 | # address_street1: "1 Infinite Loop", 16 | # address_city: "Cupertino", 17 | # address_country_code: "US" 18 | # ) 19 | # => 20 | # 21 | # Returns an instance of the desired class. 22 | module Create 23 | module ClassMethods 24 | def create(params = {}) 25 | post(endpoint, params) 26 | end 27 | end 28 | 29 | def self.included(base) 30 | base.extend(ClassMethods) 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/blockscore/actions/delete.rb: -------------------------------------------------------------------------------- 1 | require 'forwardable' 2 | 3 | module BlockScore 4 | module Actions 5 | # Provides a :delete instance method to including classes. 6 | # 7 | # Returns the updated object with deleted == true. 8 | # 9 | # Examples 10 | # 11 | # candidate.delete 12 | # => # 13 | module Delete 14 | def delete 15 | delete! 16 | rescue Error 17 | false 18 | end 19 | 20 | def delete! 21 | assert_not_deleted 22 | self.class.delete(member_endpoint, {}) 23 | attributes[:deleted] = true 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/blockscore/actions/retrieve.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Actions 3 | # Public: Provides a :retrieve class method to including classes. 4 | # 5 | # Returns a instance of the desired class on success, raises an 6 | # appropriate error otherwise. 7 | # 8 | # Examples 9 | # 10 | # person = BlockScore::Person.retrieve('abc123def456') 11 | # => # 12 | module Retrieve 13 | module ClassMethods 14 | RESOURCE_ID_FORMAT = /\A[a-f0-9]+\z/ 15 | 16 | def retrieve(id, options = {}) 17 | fail ArgumentError, 'ID must be supplied' if id.nil? || id.empty? 18 | fail ArgumentError, 'ID is malformed' unless id =~ RESOURCE_ID_FORMAT 19 | new(id: id) { get(endpoint + id, options) } 20 | end 21 | end 22 | 23 | def self.included(base) 24 | base.extend(ClassMethods) 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/blockscore/actions/update.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Actions 3 | # Public: Contains the :save instance method, which updates the 4 | # object with the BlockScore API to persist the changes. 5 | # 6 | # Examples 7 | # 8 | # class Candidate 9 | # include BlockScore::Actions::Update 10 | # end 11 | # 12 | # candidate = Candidate.new 13 | # candidate.name_first = 'John' 14 | # candidate.save 15 | # # => true 16 | module Update 17 | extend Forwardable 18 | def_delegators 'self.class', :patch 19 | 20 | def save! 21 | persisted? ? update : super() 22 | end 23 | 24 | private 25 | 26 | def update 27 | patch(member_endpoint, attributes) 28 | true 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/blockscore/actions/write_once.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Actions 3 | # Public: Contains the :save instance method, which saves the 4 | # object with the BlockScore API to persist the changes unless 5 | # already saved. 6 | # 7 | # Examples 8 | # 9 | # class Foo 10 | # include BlockScore::Actions::WriteOnce 11 | # end 12 | # 13 | # foo = Foo.new 14 | # foo.name_first = 'John' 15 | # foo.save 16 | # # => true 17 | # foo.save 18 | # # => false 19 | module WriteOnce 20 | extend Forwardable 21 | 22 | def_delegators 'self.class', :resource 23 | 24 | def save! 25 | saveable? ? super() : failure 26 | end 27 | 28 | private 29 | 30 | def saveable? 31 | id.nil? 32 | end 33 | 34 | def failure 35 | fail Error, "#{resource} is immutable once saved" 36 | end 37 | 38 | def add_setter(*) 39 | saveable? ? super : failure 40 | end 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/blockscore/base.rb: -------------------------------------------------------------------------------- 1 | require 'blockscore/connection' 2 | require 'uri' 3 | 4 | module BlockScore 5 | class Base 6 | extend Connection 7 | extend Forwardable 8 | 9 | ABSTRACT_WARNING = 'Base is an abstract class, not an API resource'.freeze 10 | IMMUTABLE_ATTRS = %i(id object created_at updated_at livemode deleted).freeze 11 | EQUAL_SIGN = '='.freeze 12 | 13 | def_delegators 'self.class', :endpoint, :post, :retrieve, :resource 14 | 15 | def initialize(options = {}, &block) 16 | @loaded = !block 17 | @proc = block 18 | @attributes = options 19 | end 20 | 21 | def attributes 22 | return @attributes if @loaded 23 | force! 24 | attributes 25 | end 26 | 27 | def id 28 | attributes[:id] 29 | end 30 | 31 | def inspect 32 | str_attr = "JSON:#{JSON.pretty_generate(attributes)}" 33 | "#<#{self.class}:#{format('%#016x', object_id << 1)} #{str_attr}>" 34 | end 35 | 36 | def save 37 | save! 38 | rescue Error 39 | false 40 | end 41 | 42 | def save! 43 | assert_not_deleted 44 | capture_attributes(post(endpoint, attributes)) 45 | true 46 | end 47 | 48 | def self.resource 49 | @resource ||= Util.to_underscore(to_s.split('::').last) 50 | end 51 | 52 | def self.endpoint 53 | fail NotImplementedError, ABSTRACT_WARNING if equal?(Base) 54 | Pathname(Util.to_plural(resource)) 55 | end 56 | 57 | def member_endpoint 58 | endpoint + id 59 | end 60 | 61 | def persisted? 62 | !id.nil? && !deleted? 63 | end 64 | 65 | def deleted? 66 | attributes.fetch(:deleted, false) 67 | end 68 | 69 | private 70 | 71 | def assert_not_deleted 72 | fail Error, "#{resource} is already deleted" if deleted? 73 | end 74 | 75 | def capture_attributes(source) 76 | @attributes = source.attributes 77 | end 78 | 79 | def add_accessor(symbol) 80 | singleton_class.instance_eval do 81 | define_method(symbol) do 82 | wrap_attribute(attributes.fetch(symbol)) 83 | end 84 | end 85 | end 86 | 87 | def add_setter(symbol) 88 | attr = symbol.to_s.chomp(EQUAL_SIGN).to_sym 89 | assert_mutable(attr) 90 | singleton_class.instance_eval do 91 | define_method(symbol) do |value| 92 | attributes[attr] = value 93 | end 94 | end 95 | end 96 | 97 | def force! 98 | @attributes = @proc.call.attributes 99 | @loaded = true 100 | end 101 | 102 | def method_missing(method, *args) 103 | super unless respond_to_missing?(method) 104 | if setter?(method) 105 | add_setter(method) 106 | else 107 | add_accessor(method) 108 | end 109 | public_send(method, *args) 110 | end 111 | 112 | def assert_mutable(attr) 113 | fail NoMethodError, "#{attr} is immutable" if IMMUTABLE_ATTRS.include?(attr) 114 | end 115 | 116 | def respond_to_missing?(symbol, *) 117 | setter?(symbol) || attributes.key?(symbol) 118 | end 119 | 120 | def setter?(symbol) 121 | symbol.to_s.end_with?(EQUAL_SIGN) 122 | end 123 | 124 | def wrap_attribute(attribute) 125 | case attribute 126 | when Array 127 | wrap_array(attribute) 128 | when Hash 129 | wrap_hash(attribute) 130 | else 131 | attribute 132 | end 133 | end 134 | 135 | def wrap_array(arr) 136 | arr.map { |item| wrap_attribute(item) } 137 | end 138 | 139 | def wrap_hash(hsh) 140 | hsh.each { |key, value| hsh[key] = wrap_attribute(value) } 141 | 142 | OpenStruct.new(hsh) 143 | end 144 | end 145 | end 146 | -------------------------------------------------------------------------------- /lib/blockscore/candidate.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Candidate < BlockScore::Base 3 | extend Forwardable 4 | 5 | include BlockScore::Actions::Create 6 | include BlockScore::Actions::Retrieve 7 | include BlockScore::Actions::Update 8 | include BlockScore::Actions::Delete 9 | include BlockScore::Actions::All 10 | 11 | def_delegators 'self.class', :get, :post 12 | 13 | def history 14 | resource_member 'history' 15 | end 16 | 17 | def hits 18 | resource_member 'hits' 19 | end 20 | 21 | def search(options = {}) 22 | post 'watchlists', options.merge(candidate_id: id) 23 | end 24 | 25 | private 26 | 27 | def resource_member(target) 28 | get member_endpoint + target, {} 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/blockscore/collection/member.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Collection 3 | # Member of a {Collection} class 4 | class Member < SimpleDelegator 5 | # Initialize a new member 6 | # 7 | # @param parent [BlockScore::Base] parent resource 8 | # @param instance [BlockScore::Base] member instance 9 | # 10 | # @return [undefined] 11 | # 12 | # @api private 13 | def initialize(parent, instance) 14 | @instance = instance 15 | @parent = parent 16 | 17 | super(instance) 18 | end 19 | 20 | # Save parent, set parent id, and save instance 21 | # 22 | # @example 23 | # # saves both unsaved person and unsaved question_set 24 | # person = Person.new(attributes) 25 | # question_set = QuestionSet.new 26 | # Member.new(person, question_set).save 27 | # 28 | # @return return value of instance `#save` 29 | # 30 | # @api public 31 | def save 32 | save_parent 33 | send(:"#{parent_name}_id=", parent.id) 34 | result = instance.save 35 | ids.push(instance.id) unless ids.include?(instance.id) 36 | result 37 | end 38 | 39 | private 40 | 41 | # Name of parent resource 42 | # 43 | # @example 44 | # self.parent_name # => 'person' 45 | # 46 | # @return [String] 47 | # 48 | # @api private 49 | def parent_name 50 | parent.class.resource 51 | end 52 | 53 | # Save parent if it hasn't already been saved 54 | # 55 | # @return return of parent.save if previously unsaved 56 | # @return nil otherwise 57 | # 58 | # @api private 59 | def save_parent 60 | parent.save! unless parent_saved? 61 | end 62 | 63 | # Check if parent is saved 64 | # 65 | # @return [Boolean] 66 | # 67 | # @api private 68 | def parent_saved? 69 | !parent.id.nil? 70 | end 71 | 72 | # @!attribute [r] instance 73 | # member instance methods are delegated to 74 | # 75 | # @return [BlockScore::Base] 76 | # 77 | # @api private 78 | attr_reader :instance 79 | 80 | # @!attribute [r] parent 81 | # collection parent the collection conditionally updates 82 | # 83 | # @return [BlockScore::Base] 84 | # 85 | # @api private 86 | attr_reader :parent 87 | 88 | # ids that belong to associated parent resource 89 | # 90 | # @return [Array] 91 | # 92 | # @api private 93 | def ids 94 | parent.attributes.fetch(resource_name, []) 95 | end 96 | 97 | # Plural resource name as symbol 98 | # 99 | # @return Symbol 100 | # 101 | # @api private 102 | def resource_name 103 | Util.to_plural(instance.class.resource).to_sym 104 | end 105 | end 106 | end 107 | end 108 | -------------------------------------------------------------------------------- /lib/blockscore/company.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Company < Base 3 | include BlockScore::Actions::Create 4 | include BlockScore::Actions::Retrieve 5 | include BlockScore::Actions::WriteOnce 6 | include BlockScore::Actions::All 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/blockscore/connection.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Connection 3 | MAJOR_VERSION = BlockScore::VERSION.split('.').first 4 | REPO = 'https://github.com/BlockScore/blockscore-ruby'.freeze 5 | API_VERSION = "version=#{MAJOR_VERSION}".freeze 6 | ACCEPT_HEADER = "application/vnd.blockscore+json;#{API_VERSION}".freeze 7 | USER_AGENT = "blockscore-ruby/#{BlockScore::VERSION} (#{REPO})".freeze 8 | CONTENT_TYPE = 'application/json'.freeze 9 | API_URL = URI.parse('https://api.blockscore.com').freeze 10 | HEADERS = { 11 | 'Accept' => ACCEPT_HEADER, 12 | 'User-Agent' => USER_AGENT, 13 | 'Content-Type' => CONTENT_TYPE 14 | }.freeze 15 | 16 | def delete(path, _) 17 | request(:delete, path, nil) 18 | end 19 | 20 | private 21 | 22 | def get(path, params) 23 | request(:get, encode_path_params(path, params), nil) 24 | end 25 | 26 | def post(path, params) 27 | request(:post, path, params.to_json) 28 | end 29 | 30 | def patch(path, params) 31 | request(:patch, path, params.to_json) 32 | end 33 | 34 | def request(method, final_endpoint, params) 35 | begin 36 | response = execute_request(method, 37 | API_URL + final_endpoint.to_s, 38 | params) 39 | rescue SocketError, Errno::ECONNREFUSED => e 40 | fail APIConnectionError, e 41 | end 42 | 43 | Response.handle_response(resource, response) 44 | end 45 | 46 | def execute_request(method, path, params) 47 | options = { basic_auth: authentication, headers: HEADERS, body: params } 48 | 49 | HTTParty.public_send(method, path, options) 50 | end 51 | 52 | def authentication 53 | fail NoAPIKeyError, 'No API key was provided.' unless BlockScore.api_key 54 | { username: BlockScore.api_key } 55 | end 56 | 57 | def encode_path_params(path, params) 58 | encoded = URI.encode_www_form(params) 59 | [path, encoded].join('?') 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /lib/blockscore/dispatch.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Dispatch 3 | extend Forwardable 4 | 5 | def_delegators :@fingerprint, :builder, :data, :resource 6 | 7 | def initialize(resource, response) 8 | @fingerprint = Fingerprint.new(resource, response.body) 9 | end 10 | 11 | def call 12 | Util.send(builder, resource, data) 13 | end 14 | 15 | private 16 | 17 | def builder 18 | resource_array? ? :create_array : :create_object 19 | end 20 | 21 | # array formatted response 22 | def resource_array? 23 | data.is_a?(Array) 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/blockscore/errors/api_connection_error.rb: -------------------------------------------------------------------------------- 1 | require 'blockscore/errors/error' 2 | 3 | module BlockScore 4 | class APIConnectionError < Error 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/blockscore/errors/api_error.rb: -------------------------------------------------------------------------------- 1 | require 'blockscore/errors/error' 2 | 3 | module BlockScore 4 | class APIError < Error 5 | attr_reader :http_status 6 | attr_reader :error_type 7 | attr_reader :http_body 8 | 9 | # Public: Creates a new instance of BlockScore::Error. 10 | # 11 | # rbody - The HTTP response body from HTTParty. 12 | # rcode - The HTTP response code from HTTParty. 13 | # 14 | # While BlockScore::Error can be instantiated, the more meaningful 15 | # error classes are its subclasses: 16 | # InvalidRequestError - Indicates a malformed request (HTTP 400 or 404) 17 | # APIError - Indicates an error on the server side (HTTP 5xx) 18 | # AuthenticationError - Indicates an authentication error (HTTP 401) 19 | def initialize(response) 20 | @http_body = JSON.parse(response.body, symbolize_names: true) 21 | 22 | @message = error_advice.fetch(:message) 23 | @http_status = response.code 24 | @error_type = error_advice.fetch(:type) 25 | end 26 | 27 | def to_s 28 | "#{type_string} #{@message} #{status_string}" 29 | end 30 | 31 | private 32 | 33 | def error_advice 34 | http_body.fetch(:error) 35 | end 36 | 37 | def type_string 38 | "(Type: #{error_type})" 39 | end 40 | 41 | def status_string 42 | "(Status: #{http_status})" 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /lib/blockscore/errors/authentication_error.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class AuthenticationError < APIError 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /lib/blockscore/errors/error.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Error < StandardError 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /lib/blockscore/errors/invalid_request_error.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class InvalidRequestError < APIError 3 | attr_accessor :param 4 | 5 | # Public: Creates a new instance of BlockScore::InvalidRequestError. 6 | # 7 | # responses - The HTTP response body from HTTParty. 8 | # 9 | # Examples 10 | # 11 | # begin 12 | # response = BlockScore::Person.create(...) 13 | # rescue BlockScore::InvalidRequestError => e 14 | # puts "ERROR: #{e.message} with code #{e.http_status}" 15 | # end 16 | def initialize(response) 17 | super 18 | @param = error_advice[:param] 19 | end 20 | 21 | def to_s 22 | "#{type_string} #{@message} #{param_string} #{status_string}" 23 | end 24 | 25 | private 26 | 27 | def param_string 28 | "(#{param})" if param 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/blockscore/errors/no_api_key_error.rb: -------------------------------------------------------------------------------- 1 | require 'blockscore/errors/error' 2 | 3 | module BlockScore 4 | class NoAPIKeyError < Error 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/blockscore/errors/not_found_error.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class NotFoundError < APIError 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /lib/blockscore/fingerprint.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Fingerprint 3 | def initialize(resource, body) 4 | @resource = resource 5 | @body = Util.parse_json(body) 6 | end 7 | 8 | def data 9 | @data ||= begin 10 | if watchlist_search? 11 | body.fetch(:matches) 12 | elsif resource_index? 13 | body.fetch(:data) 14 | else 15 | body 16 | end 17 | end 18 | end 19 | 20 | def resource 21 | if watchlist_search? || watchlist_hits? 22 | 'watchlist_hit' 23 | else 24 | @resource 25 | end 26 | end 27 | 28 | private 29 | 30 | attr_reader :body 31 | 32 | # candidates#search endpoint 33 | def watchlist_search? 34 | body.respond_to?(:key?) && body.key?(:matches) 35 | end 36 | 37 | # hash style list format 38 | def resource_index? 39 | body.is_a?(Hash) && list_object? 40 | end 41 | 42 | def list_object? 43 | body.fetch(:object).eql?('list') 44 | end 45 | 46 | def watchlist_hits? 47 | data.first.is_a?(Hash) && data.first.key?(:matching_info) 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /lib/blockscore/person.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class Person < Base 3 | VALID = 'valid'.freeze 4 | INVALID = 'invalid'.freeze 5 | 6 | include BlockScore::Actions::Create 7 | include BlockScore::Actions::Retrieve 8 | include BlockScore::Actions::WriteOnce 9 | include BlockScore::Actions::All 10 | 11 | attr_reader :question_sets 12 | 13 | def initialize(*) 14 | super 15 | @question_sets = Collection.new(self, QuestionSet) 16 | end 17 | 18 | def valid? 19 | status?(VALID) 20 | end 21 | 22 | def invalid? 23 | status?(INVALID) 24 | end 25 | 26 | private 27 | 28 | def status?(expected) 29 | status.eql?(expected) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/blockscore/question_set.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class QuestionSet < Base 3 | extend Forwardable 4 | 5 | include BlockScore::Actions::Create 6 | include BlockScore::Actions::Retrieve 7 | include BlockScore::Actions::WriteOnce 8 | include BlockScore::Actions::All 9 | 10 | def_delegators 'self.class', :post 11 | 12 | def score(answers = nil) 13 | rescore(answers) if answers 14 | attributes.fetch(:score) 15 | end 16 | 17 | private 18 | 19 | def rescore(answers) 20 | capture_attributes(post(member_endpoint + 'score', answers: answers)) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/blockscore/response.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Response 3 | extend self 4 | 5 | def handle_response(resource, response) 6 | case response.code 7 | when 200, 201 8 | Dispatch.new(resource, response).call 9 | else 10 | api_error(response) 11 | end 12 | end 13 | 14 | private 15 | 16 | def api_error(response) 17 | fail error_class(response), response 18 | end 19 | 20 | def error_class(response) 21 | case response.code 22 | when 400 then 23 | InvalidRequestError 24 | when 401 then 25 | AuthenticationError 26 | when 404 then 27 | NotFoundError 28 | else 29 | APIError 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/blockscore/util.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | module Util 3 | extend self 4 | 5 | PLURAL_LOOKUP = { 6 | 'candidate' => 'candidates', 7 | 'company' => 'companies', 8 | 'person' => 'people', 9 | 'question_set' => 'question_sets', 10 | 'watchlist_hit' => 'watchlist_hits' 11 | }.freeze 12 | 13 | PARSE_ERROR = 14 | 'An error has occurred. ' \ 15 | 'If this problem persists, ' \ 16 | 'please message support@blockscore.com.'.freeze 17 | 18 | def parse_json!(json_obj) 19 | JSON.parse(json_obj, symbolize_names: true) 20 | end 21 | 22 | def parse_json(json_obj) 23 | parse_json! json_obj 24 | rescue JSON::ParserError 25 | fail Error, PARSE_ERROR 26 | end 27 | 28 | def create_object(resource, options = {}) 29 | to_constant("BlockScore::#{to_camelcase(resource)}").new(options) 30 | end 31 | 32 | def create_array(resource, arr) 33 | arr.map { |obj| create_object(resource, obj) } 34 | end 35 | 36 | def to_plural(str) 37 | PLURAL_LOOKUP.fetch(str) 38 | end 39 | 40 | # Taken from activesupport: http://git.io/vkWtR 41 | def to_constant(camel_cased_word) 42 | names = camel_cased_word.split('::') 43 | 44 | # Trigger a built-in NameError exception including 45 | # the ill-formed constant in the message. 46 | Object.const_get(camel_cased_word) if names.empty? 47 | 48 | # Remove the first blank element in case of '::ClassName' notation. 49 | names.shift if names.size > 1 && names.first.empty? 50 | 51 | names.inject(Object) do |constant, name| 52 | if constant.equal?(Object) 53 | constant.const_get(name) 54 | else 55 | candidate = constant.const_get(name) 56 | next candidate if constant.const_defined?(name, false) 57 | next candidate unless Object.const_defined?(name) 58 | 59 | # Go down the ancestors to check if it is owned directly. The check 60 | # stops when we reach Object or the end of ancestors tree. 61 | constant = constant.ancestors.inject do |const, ancestor| 62 | break const if ancestor.equal?(Object) 63 | break ancestor if ancestor.const_defined?(name, false) 64 | const 65 | end 66 | 67 | # owner is in Object, so raise 68 | constant.const_get(name, false) 69 | end 70 | end 71 | end 72 | 73 | def to_camelcase(str) 74 | str.split('_').map(&:capitalize).join 75 | end 76 | 77 | # Taken from Rulers: http://git.io/vkWqf 78 | def to_underscore(str) 79 | str.gsub(/::/, '/') 80 | .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') 81 | .gsub(/([a-z\d])([A-Z])/, '\1_\2') 82 | .tr('-', '_') 83 | .downcase 84 | end 85 | end 86 | end 87 | -------------------------------------------------------------------------------- /lib/blockscore/version.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | VERSION = '4.2.1'.freeze 3 | end 4 | -------------------------------------------------------------------------------- /lib/blockscore/watchlist_hit.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | class WatchlistHit < Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_Create/_create/1_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1977-10-06","name_first":"Payton","name_last":"Schumm","address_street1":"530 9 | Mohamed Pass","address_city":"Jocelynborough","address_country_code":"WS"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"2d526b859ec946f2e9f98c2c2808c347" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 9b261d46-85db-4fa4-aff6-e5d24f64fbc2 40 | X-Runtime: 41 | - '0.034654' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:46 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdb8662373800030000f8","created_at":1456462726,"updated_at":1456462726,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1977-10-06","name_first":"Payton","name_middle":null,"name_last":"Schumm","address_street1":"530 57 | Mohamed Pass","address_street2":null,"address_city":"Jocelynborough","address_subdivision":null,"address_postal_code":null,"address_country_code":"WS"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:58:46 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_Create/_create/1_1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1965-10-23","name_first":"Murphy","name_last":"Abshire","address_street1":"7784 9 | Schuppe Meadows","address_city":"Aliviabury","address_country_code":"CN"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"56d2864da91023e50f0ef227e6a70746" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 95c1bb73-d046-4fb6-8a73-bbb36f1772bc 40 | X-Runtime: 41 | - '0.035718' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:46 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdb8636636100030000ac","created_at":1456462726,"updated_at":1456462726,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1965-10-23","name_first":"Murphy","name_middle":null,"name_last":"Abshire","address_street1":"7784 57 | Schuppe Meadows","address_street2":null,"address_city":"Aliviabury","address_subdivision":null,"address_postal_code":null,"address_country_code":"CN"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:58:46 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_Delete/_delete_/deleted_/1_2_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1974-01-29","name_first":"Mozell","name_last":"Kutch","address_street1":"224 9 | Metz Spur","address_city":"Laceymouth","address_country_code":"PY"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"12a8799cdb76f92f64c182897f50d2f8" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 55082b0c-c83c-421b-82f6-091ccf8cb69b 40 | X-Runtime: 41 | - '0.036680' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:16 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbdf36636100030000b7","created_at":1456462816,"updated_at":1456462816,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1974-01-29","name_first":"Mozell","name_middle":null,"name_last":"Kutch","address_street1":"224 57 | Metz Spur","address_street2":null,"address_city":"Laceymouth","address_subdivision":null,"address_postal_code":null,"address_country_code":"PY"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:16 GMT 60 | - request: 61 | method: delete 62 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates/56cfdbdf36636100030000b7 63 | body: 64 | encoding: US-ASCII 65 | string: '' 66 | headers: 67 | Accept: 68 | - application/vnd.blockscore+json;version=4 69 | User-Agent: 70 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 71 | Content-Type: 72 | - application/json 73 | response: 74 | status: 75 | code: 200 76 | message: OK 77 | headers: 78 | Server: 79 | - Cowboy 80 | Connection: 81 | - keep-alive 82 | X-Frame-Options: 83 | - SAMEORIGIN 84 | X-Xss-Protection: 85 | - 1; mode=block 86 | X-Content-Type-Options: 87 | - nosniff 88 | Content-Type: 89 | - application/json; charset=utf-8 90 | Etag: 91 | - W/"12870e0f2d0e0e9132dfd09c51306f30" 92 | Cache-Control: 93 | - max-age=0, private, must-revalidate 94 | X-Request-Id: 95 | - f85fd454-b84e-42af-8a20-9757e1c4d851 96 | X-Runtime: 97 | - '0.017197' 98 | Strict-Transport-Security: 99 | - max-age=31536000 100 | Date: 101 | - Fri, 26 Feb 2016 05:00:16 GMT 102 | X-Rack-Cache: 103 | - invalidate, pass 104 | Set-Cookie: 105 | - __profilin=p%3Dt; path=/ 106 | Transfer-Encoding: 107 | - chunked 108 | Via: 109 | - 1.1 vegur 110 | body: 111 | encoding: UTF-8 112 | string: '{"object":"candidate","id":"56cfdbdf36636100030000b7","created_at":1456462816,"updated_at":1456462816,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1974-01-29","name_first":"Mozell","name_middle":null,"name_last":"Kutch","address_street1":"224 113 | Metz Spur","address_street2":null,"address_city":"Laceymouth","address_subdivision":null,"address_postal_code":null,"address_country_code":"PY","deleted":true}' 114 | http_version: 115 | recorded_at: Fri, 26 Feb 2016 05:00:16 GMT 116 | recorded_with: VCR 3.0.1 117 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_WriteOnce/_save_/when_creating_a_new_person/1_1_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Johanna","name_last":"Mohr","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":5,"birth_year":1973,"address_street1":"73192 9 | Dixie Lodge","address_city":"Hyattshire","address_subdivision":"MD","address_postal_code":"37688","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"a588c4a12471ad4f43379a3ee5297476" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 3441ced1-caf4-4ba6-828b-2c445b20bf4f 40 | X-Runtime: 41 | - '0.261206' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:48 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdb8862373800030000fa","created_at":1456462728,"updated_at":1456462728,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":5,"birth_year":1973,"name_first":"Johanna","name_middle":null,"name_last":"Mohr","address_street1":"73192 57 | Dixie Lodge","address_street2":null,"address_city":"Hyattshire","address_subdivision":"MD","address_postal_code":"37688","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:58:48 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_WriteOnce/_save_/when_creating_a_new_person/name_first/1_1_1_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Bradford","name_last":"Pacocha","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":2,"birth_year":1989,"address_street1":"77159 9 | Greenfelder Falls","address_city":"East Marilyne","address_subdivision":"AK","address_postal_code":"62252-4163","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"b8e3c9e11431956e437e4742c6ff739d" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - c6c5c177-f105-46af-94db-7f91e7f37232 40 | X-Runtime: 41 | - '0.262401' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:49 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdb8862373800030000fb","created_at":1456462728,"updated_at":1456462728,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":2,"birth_year":1989,"name_first":"Bradford","name_middle":null,"name_last":"Pacocha","address_street1":"77159 57 | Greenfelder Falls","address_street2":null,"address_city":"East Marilyne","address_subdivision":"AK","address_postal_code":"62252-4163","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:58:49 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_WriteOnce/_save_/when_updating_an_existing_person/prevents_saving.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"John","name_last":"Wilkinson","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":1,"birth_year":1958,"address_street1":"479 9 | Koch Forks","address_city":"North Emmanuelmouth","address_subdivision":"IN","address_postal_code":"36058-0299","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"bc24e3e30fc5398007c26e1955ded507" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - dd2f2588-81b5-41c1-b1bb-70e550967aa2 40 | X-Runtime: 41 | - '0.274866' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:49 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Transfer-Encoding: 49 | - chunked 50 | Via: 51 | - 1.1 vegur 52 | body: 53 | encoding: UTF-8 54 | string: '{"object":"person","id":"56cfdb8934626100030000bf","created_at":1456462729,"updated_at":1456462729,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":1,"birth_year":1958,"name_first":"John","name_middle":null,"name_last":"Wilkinson","address_street1":"479 55 | Koch Forks","address_street2":null,"address_city":"North Emmanuelmouth","address_subdivision":"IN","address_postal_code":"36058-0299","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:58:49 GMT 58 | recorded_with: VCR 3.0.1 59 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Actions_WriteOnce/object_is_immutable/prevents_alteration.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"John","name_last":"Metz","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":7,"birth_year":1946,"address_street1":"567 9 | Fay Drive","address_city":"Blanchechester","address_subdivision":"VT","address_postal_code":"21093-2904","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"c8cf465b9241bf041e2a56003c8b4a2f" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 495a6176-1072-48db-95c6-10fd696b1882 40 | X-Runtime: 41 | - '0.285552' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:58:47 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdb8762373800030000f9","created_at":1456462727,"updated_at":1456462727,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":7,"birth_year":1946,"name_first":"John","name_middle":null,"name_last":"Metz","address_street1":"567 57 | Fay Drive","address_street2":null,"address_city":"Blanchechester","address_subdivision":"VT","address_postal_code":"21093-2904","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:58:47 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_capture_attributes/captures_the_attributes_from_a_http_response.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1985-07-10","name_first":"John","name_last":"McDermott","address_street1":"2784 9 | Mable Park","address_city":"Deborahberg","address_country_code":"FK"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"38bf43a1dc64a1e8c8f021de0758d4eb" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 50541520-d19c-40ff-9fc7-b8f89a5f3bbe 40 | X-Runtime: 41 | - '0.033302' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:57 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbcd6237380003000131","created_at":1456462797,"updated_at":1456462797,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1985-07-10","name_first":"John","name_middle":null,"name_last":"McDermott","address_street1":"2784 57 | Mable Park","address_street2":null,"address_city":"Deborahberg","address_subdivision":null,"address_postal_code":null,"address_country_code":"FK"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:57 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_id/id/1_7_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1998-08-20","name_first":"Alexys","name_last":"Smith","address_street1":"4909 9 | Greg Garden","address_city":"Gottliebborough","address_country_code":"CZ"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"639478541354eed0b70f0450cbff3b84" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 0da6f26d-2eb9-45b3-b0d9-182013e6457c 40 | X-Runtime: 41 | - '0.036113' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:02 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbd26237380003000138","created_at":1456462802,"updated_at":1456462802,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1998-08-20","name_first":"Alexys","name_middle":null,"name_last":"Smith","address_street1":"4909 57 | Greg Garden","address_street2":null,"address_city":"Gottliebborough","address_subdivision":null,"address_postal_code":null,"address_country_code":"CZ"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:02 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_inspect/1_9_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1937-01-12","name_first":"Ernie","name_last":"Daniel","address_street1":"25243 9 | Gunnar Flats","address_city":"Lake Chesley","address_country_code":"ID"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"781ead16161ac3bf7bc046810d7c1e9a" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 1ea6bed5-4ce7-4439-8362-6ba623dbe591 40 | X-Runtime: 41 | - '0.034172' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:08 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbd8623738000300013c","created_at":1456462808,"updated_at":1456462808,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1937-01-12","name_first":"Ernie","name_middle":null,"name_last":"Daniel","address_street1":"25243 57 | Gunnar Flats","address_street2":null,"address_city":"Lake Chesley","address_subdivision":null,"address_postal_code":null,"address_country_code":"ID"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:08 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_inspect/1_9_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1991-07-02","name_first":"Humberto","name_last":"Corkery","address_street1":"5787 9 | Roslyn Village","address_city":"Websterberg","address_country_code":"MW"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"ec13fa22dce62470940d4a34fcc95763" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - b6681a08-d55a-45ba-8e70-d3f047fa54ea 40 | X-Runtime: 41 | - '0.043309' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:08 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbd865663600030000cc","created_at":1456462808,"updated_at":1456462808,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1991-07-02","name_first":"Humberto","name_middle":null,"name_last":"Corkery","address_street1":"5787 57 | Roslyn Village","address_street2":null,"address_city":"Websterberg","address_subdivision":null,"address_postal_code":null,"address_country_code":"MW"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:08 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_save/when_creating_a_new_candidate/name_first/1_1_1_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1976-05-02","name_first":"Bernadette","name_last":"Schroeder","address_street1":"129 9 | Beer Mission","address_city":"Lake Kelvin","address_country_code":"JM"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e4a773cdda84a5b4f5a13f7e6a662002" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 37325b17-d833-4111-92d2-934ddf9ab3b3 40 | X-Runtime: 41 | - '0.036386' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:58 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbce36636100030000b6","created_at":1456462798,"updated_at":1456462798,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1976-05-02","name_first":"Bernadette","name_middle":null,"name_last":"Schroeder","address_street1":"129 57 | Beer Mission","address_street2":null,"address_city":"Lake Kelvin","address_subdivision":null,"address_postal_code":null,"address_country_code":"JM"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:58 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_save/when_creating_a_new_candidate/persisted_/1_1_1_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"1979-07-11","name_first":"Savanna","name_last":"Lehner","address_street1":"132 9 | Araceli Cove","address_city":"South Rowena","address_country_code":"CC"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e0f91f2c979ebe8ae379cdba761fea88" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 04f648b1-a4b9-4abd-a6b6-4135432e4c15 40 | X-Runtime: 41 | - '0.034298' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:58 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbce6237380003000133","created_at":1456462798,"updated_at":1456462798,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"1979-07-11","name_first":"Savanna","name_middle":null,"name_last":"Lehner","address_street1":"132 57 | Araceli Cove","address_street2":null,"address_city":"South Rowena","address_subdivision":null,"address_postal_code":null,"address_country_code":"CC"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:58 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_save_/when_updating_an_new_candidate/successfully_saves_an_alteration.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":"0000","date_of_birth":"2008-04-14","name_first":"Jane","name_last":"Goyette","address_street1":"16149 9 | Grimes Passage","address_city":"Bodefurt","address_country_code":"GU"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"81b5efbfa8e3ac434cbd3950c9d89f37" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - ebd4389d-e15b-40ac-b08f-10958285bc8a 40 | X-Runtime: 41 | - '0.037922' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:00 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"candidate","id":"56cfdbd06237380003000136","created_at":1456462800,"updated_at":1456462800,"livemode":false,"note":null,"ssn":"0000","passport":null,"date_of_birth":"2008-04-14","name_first":"Jane","name_middle":null,"name_last":"Goyette","address_street1":"16149 57 | Grimes Passage","address_street2":null,"address_city":"Bodefurt","address_subdivision":null,"address_postal_code":null,"address_country_code":"GU"}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:01 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Base/_wrap_hash/details/1_8_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Halie","name_last":"Smith","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":3,"birth_year":2012,"address_street1":"582 9 | Okuneva Bypass","address_city":"South Victoriafurt","address_subdivision":"CA","address_postal_code":"38928-8840","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"79925ae61cf4ea99485f21d005f56c81" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 432bcd20-0cc9-4da9-99cd-c2b6cadcf492 40 | X-Runtime: 41 | - '0.272101' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:05 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbd5623738000300013a","created_at":1456462805,"updated_at":1456462805,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":3,"birth_year":2012,"name_first":"Halie","name_middle":null,"name_last":"Smith","address_street1":"582 57 | Okuneva Bypass","address_street2":null,"address_city":"South Victoriafurt","address_subdivision":"CA","address_postal_code":"38928-8840","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:05 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_create/1_2_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: "{}" 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"a0fcd5241e1ed973854fd03d73f05e56" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - a1f3eeab-f66f-4e59-9ad7-0b2b36bfe971 39 | X-Runtime: 40 | - '0.047911' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:59:05 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb9836636100030000af","created_at":1456462744,"updated_at":1456462744,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":null,"name_middle":null,"name_last":null,"address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:59:05 GMT 58 | recorded_with: VCR 3.0.1 59 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_create/persisted_/1_2_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: "{}" 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"b6fcb7c5bc01e3d841e5993b79306d32" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - 9495ff57-20b8-4b07-8997-382d7f9f13ca 39 | X-Runtime: 40 | - '0.038680' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:59:05 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb9965663600030000c8","created_at":1456462745,"updated_at":1456462745,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":null,"name_middle":null,"name_last":null,"address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:59:05 GMT 58 | recorded_with: VCR 3.0.1 59 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_search/cannot_search_on_unsaved_candidate/is_an_invalid_request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/watchlists 6 | body: 7 | encoding: UTF-8 8 | string: '{"candidate_id":null}' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 404 19 | message: Not Found 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Cache-Control: 34 | - no-cache 35 | X-Request-Id: 36 | - b280ef79-8401-4e3e-a033-083ba2b0b8c8 37 | X-Runtime: 38 | - '0.007548' 39 | Strict-Transport-Security: 40 | - max-age=31536000 41 | Date: 42 | - Fri, 26 Feb 2016 04:59:04 GMT 43 | X-Rack-Cache: 44 | - invalidate, pass 45 | Set-Cookie: 46 | - __profilin=p%3Dt; path=/ 47 | Transfer-Encoding: 48 | - chunked 49 | Via: 50 | - 1.1 vegur 51 | body: 52 | encoding: UTF-8 53 | string: '{"error":{"type":"invalid_request_error","message":"Candidate with 54 | id could not be found"}}' 55 | http_version: 56 | recorded_at: Fri, 26 Feb 2016 04:59:04 GMT 57 | recorded_with: VCR 3.0.1 58 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_search/proof_of_similarity_filtering/1_6_8_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"mohammed"}' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"5585b23acee4ddc8de3063a1b3140cfc" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - 8e31b514-6aa9-42d5-927b-74b04bc7512d 39 | X-Runtime: 40 | - '0.030882' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:58:56 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb906237380003000101","created_at":1456462736,"updated_at":1456462736,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":"mohammed","name_middle":null,"name_last":null,"address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:58:56 GMT 58 | - request: 59 | method: post 60 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/watchlists 61 | body: 62 | encoding: UTF-8 63 | string: '{"similarity_threshold":0.98,"candidate_id":"56cfdb906237380003000101"}' 64 | headers: 65 | Accept: 66 | - application/vnd.blockscore+json;version=4 67 | User-Agent: 68 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 69 | Content-Type: 70 | - application/json 71 | response: 72 | status: 73 | code: 200 74 | message: OK 75 | headers: 76 | Server: 77 | - Cowboy 78 | Connection: 79 | - keep-alive 80 | X-Frame-Options: 81 | - SAMEORIGIN 82 | X-Xss-Protection: 83 | - 1; mode=block 84 | X-Content-Type-Options: 85 | - nosniff 86 | Content-Type: 87 | - application/json; charset=utf-8 88 | Etag: 89 | - W/"ed3ede833e93ed7fe9743a906e06a616" 90 | Cache-Control: 91 | - max-age=0, private, must-revalidate 92 | X-Request-Id: 93 | - 3266b7b1-efb6-47f4-942b-983c2f6aec32 94 | X-Runtime: 95 | - '0.117019' 96 | Strict-Transport-Security: 97 | - max-age=31536000 98 | Date: 99 | - Fri, 26 Feb 2016 04:58:57 GMT 100 | X-Rack-Cache: 101 | - invalidate, pass 102 | Set-Cookie: 103 | - __profilin=p%3Dt; path=/ 104 | Transfer-Encoding: 105 | - chunked 106 | Via: 107 | - 1.1 vegur 108 | body: 109 | encoding: UTF-8 110 | string: '{"livemode":false,"searched_lists":[],"count":0,"matches":[]}' 111 | http_version: 112 | recorded_at: Fri, 26 Feb 2016 04:58:57 GMT 113 | recorded_with: VCR 3.0.1 114 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_search/proof_of_similarity_filtering_with_match_on_company/1_6_10_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"mohammed"}' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"b7db51c1f474fab676ab7bd0ea6a3104" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - a6b49ed8-d905-49cc-86e6-b7b69fc48fb1 39 | X-Runtime: 40 | - '0.033846' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:59:01 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb956237380003000106","created_at":1456462741,"updated_at":1456462741,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":"mohammed","name_middle":null,"name_last":null,"address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:59:01 GMT 58 | - request: 59 | method: post 60 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/watchlists 61 | body: 62 | encoding: UTF-8 63 | string: '{"match_type":"company","similarity_threshold":0.93,"candidate_id":"56cfdb956237380003000106"}' 64 | headers: 65 | Accept: 66 | - application/vnd.blockscore+json;version=4 67 | User-Agent: 68 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 69 | Content-Type: 70 | - application/json 71 | response: 72 | status: 73 | code: 200 74 | message: OK 75 | headers: 76 | Server: 77 | - Cowboy 78 | Connection: 79 | - keep-alive 80 | X-Frame-Options: 81 | - SAMEORIGIN 82 | X-Xss-Protection: 83 | - 1; mode=block 84 | X-Content-Type-Options: 85 | - nosniff 86 | Content-Type: 87 | - application/json; charset=utf-8 88 | Etag: 89 | - W/"ed3ede833e93ed7fe9743a906e06a616" 90 | Cache-Control: 91 | - max-age=0, private, must-revalidate 92 | X-Request-Id: 93 | - 916caaca-0470-4753-9c59-ceceaf0e4f7b 94 | X-Runtime: 95 | - '0.091978' 96 | Strict-Transport-Security: 97 | - max-age=31536000 98 | Date: 99 | - Fri, 26 Feb 2016 04:59:02 GMT 100 | X-Rack-Cache: 101 | - invalidate, pass 102 | Set-Cookie: 103 | - __profilin=p%3Dt; path=/ 104 | Transfer-Encoding: 105 | - chunked 106 | Via: 107 | - 1.1 vegur 108 | body: 109 | encoding: UTF-8 110 | string: '{"livemode":false,"searched_lists":[],"count":0,"matches":[]}' 111 | http_version: 112 | recorded_at: Fri, 26 Feb 2016 04:59:02 GMT 113 | recorded_with: VCR 3.0.1 114 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_search/search_by_company/1_6_5_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: '{"ssn":null,"date_of_birth":null,"name_first":"John","name_last":"Bredenkamp","address_street1":null,"address_city":null,"address_country_code":null}' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"bba8b3cb9e4418da466ac889014efa3b" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - 1e803cb1-a621-49c0-b4cb-62e740275da9 39 | X-Runtime: 40 | - '0.034053' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:59:03 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb976237380003000107","created_at":1456462743,"updated_at":1456462743,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":"John","name_middle":null,"name_last":"Bredenkamp","address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:59:03 GMT 58 | - request: 59 | method: post 60 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/watchlists 61 | body: 62 | encoding: UTF-8 63 | string: '{"match_type":"company","candidate_id":"56cfdb976237380003000107"}' 64 | headers: 65 | Accept: 66 | - application/vnd.blockscore+json;version=4 67 | User-Agent: 68 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 69 | Content-Type: 70 | - application/json 71 | response: 72 | status: 73 | code: 200 74 | message: OK 75 | headers: 76 | Server: 77 | - Cowboy 78 | Connection: 79 | - keep-alive 80 | X-Frame-Options: 81 | - SAMEORIGIN 82 | X-Xss-Protection: 83 | - 1; mode=block 84 | X-Content-Type-Options: 85 | - nosniff 86 | Content-Type: 87 | - application/json; charset=utf-8 88 | Etag: 89 | - W/"ed3ede833e93ed7fe9743a906e06a616" 90 | Cache-Control: 91 | - max-age=0, private, must-revalidate 92 | X-Request-Id: 93 | - 1a88e714-3ff7-4ae5-b12c-af94bc28a646 94 | X-Runtime: 95 | - '0.030833' 96 | Strict-Transport-Security: 97 | - max-age=31536000 98 | Date: 99 | - Fri, 26 Feb 2016 04:59:04 GMT 100 | X-Rack-Cache: 101 | - invalidate, pass 102 | Set-Cookie: 103 | - __profilin=p%3Dt; path=/ 104 | Transfer-Encoding: 105 | - chunked 106 | Via: 107 | - 1.1 vegur 108 | body: 109 | encoding: UTF-8 110 | string: '{"livemode":false,"searched_lists":[],"count":0,"matches":[]}' 111 | http_version: 112 | recorded_at: Fri, 26 Feb 2016 04:59:04 GMT 113 | recorded_with: VCR 3.0.1 114 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Candidate/_search/search_empty_candidate_with_similarity/1_6_7_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/candidates 6 | body: 7 | encoding: UTF-8 8 | string: "{}" 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 201 19 | message: Created 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Etag: 34 | - W/"3bab86bdf8c768de8472097744e55c11" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - 9046f3ad-93fe-4df8-ad2d-6c3aac0fa6ad 39 | X-Runtime: 40 | - '0.037071' 41 | Strict-Transport-Security: 42 | - max-age=31536000 43 | Date: 44 | - Fri, 26 Feb 2016 04:59:02 GMT 45 | X-Rack-Cache: 46 | - invalidate, pass 47 | Set-Cookie: 48 | - __profilin=p%3Dt; path=/ 49 | Transfer-Encoding: 50 | - chunked 51 | Via: 52 | - 1.1 vegur 53 | body: 54 | encoding: UTF-8 55 | string: '{"object":"candidate","id":"56cfdb9634626100030000c3","created_at":1456462742,"updated_at":1456462742,"livemode":false,"note":null,"ssn":null,"passport":null,"date_of_birth":null,"name_first":null,"name_middle":null,"name_last":null,"address_street1":null,"address_street2":null,"address_city":null,"address_subdivision":null,"address_postal_code":null,"address_country_code":null}' 56 | http_version: 57 | recorded_at: Fri, 26 Feb 2016 04:59:02 GMT 58 | - request: 59 | method: post 60 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/watchlists 61 | body: 62 | encoding: UTF-8 63 | string: '{"similarity_threshold":0.0,"candidate_id":"56cfdb9634626100030000c3"}' 64 | headers: 65 | Accept: 66 | - application/vnd.blockscore+json;version=4 67 | User-Agent: 68 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 69 | Content-Type: 70 | - application/json 71 | response: 72 | status: 73 | code: 200 74 | message: OK 75 | headers: 76 | Server: 77 | - Cowboy 78 | Connection: 79 | - keep-alive 80 | X-Frame-Options: 81 | - SAMEORIGIN 82 | X-Xss-Protection: 83 | - 1; mode=block 84 | X-Content-Type-Options: 85 | - nosniff 86 | Content-Type: 87 | - application/json; charset=utf-8 88 | Etag: 89 | - W/"ed3ede833e93ed7fe9743a906e06a616" 90 | Cache-Control: 91 | - max-age=0, private, must-revalidate 92 | X-Request-Id: 93 | - 5fc326f1-bd17-4dee-bfeb-7acb2f6d56fc 94 | X-Runtime: 95 | - '0.035855' 96 | Strict-Transport-Security: 97 | - max-age=31536000 98 | Date: 99 | - Fri, 26 Feb 2016 04:59:03 GMT 100 | X-Rack-Cache: 101 | - invalidate, pass 102 | Set-Cookie: 103 | - __profilin=p%3Dt; path=/ 104 | Transfer-Encoding: 105 | - chunked 106 | Via: 107 | - 1.1 vegur 108 | body: 109 | encoding: UTF-8 110 | string: '{"livemode":false,"searched_lists":[],"count":0,"matches":[]}' 111 | http_version: 112 | recorded_at: Fri, 26 Feb 2016 04:59:03 GMT 113 | recorded_with: VCR 3.0.1 114 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Merlin","name_last":"Fritsch","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":4,"birth_year":1942,"address_street1":"9845 9 | Wunsch Highway","address_city":"East Josefinaborough","address_subdivision":"WV","address_postal_code":"24985","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"aea2c7f92766eee2e5570e88a2dfc9e0" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 7251e69e-e380-4d91-bd7b-0f15a9bc212e 40 | X-Runtime: 41 | - '0.256814' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:23 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbaa623738000300010f","created_at":1456462762,"updated_at":1456462762,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":4,"birth_year":1942,"name_first":"Merlin","name_middle":null,"name_last":"Fritsch","address_street1":"9845 57 | Wunsch Highway","address_street2":null,"address_city":"East Josefinaborough","address_subdivision":"WV","address_postal_code":"24985","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:23 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Jovanny","name_last":"Terry","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":8,"birth_year":1934,"address_street1":"31313 9 | Antonette Mountain","address_city":"Lowebury","address_subdivision":"UT","address_postal_code":"39498","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"b0cc4da3e5c70b37bddd63a7d090773a" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 9f1e50e0-f059-4109-97df-c0608c711d33 40 | X-Runtime: 41 | - '0.272161' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:22 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbaa623738000300010e","created_at":1456462762,"updated_at":1456462762,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":8,"birth_year":1934,"name_first":"Jovanny","name_middle":null,"name_last":"Terry","address_street1":"31313 57 | Antonette Mountain","address_street2":null,"address_city":"Lowebury","address_subdivision":"UT","address_postal_code":"39498","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:22 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_all/1_3_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Annabel","name_last":"Stehr","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":3,"birth_year":1950,"address_street1":"812 9 | Thiel Loaf","address_city":"Colinshire","address_subdivision":"VT","address_postal_code":"14016","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"5e5b5fd1d87b8eb93857562190f09c82" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 6ab091ff-b3de-4e20-b5e0-6e3ac24aeda7 40 | X-Runtime: 41 | - '0.297059' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:23 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbab6237380003000110","created_at":1456462763,"updated_at":1456462763,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":3,"birth_year":1950,"name_first":"Annabel","name_middle":null,"name_last":"Stehr","address_street1":"812 57 | Thiel Loaf","address_street2":null,"address_city":"Colinshire","address_subdivision":"VT","address_postal_code":"14016","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:23 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_all/1_3_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Alessandra","name_last":"Boehm","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":12,"birth_year":1929,"address_street1":"879 9 | Labadie Greens","address_city":"South Jalyn","address_subdivision":"VA","address_postal_code":"80373-0442","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"7cdfdf056e4138c21a02aa6c85e9865f" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 8a821a8b-a776-44ef-8ca2-6815f542ff98 40 | X-Runtime: 41 | - '0.281259' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:24 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbac6237380003000111","created_at":1456462764,"updated_at":1456462764,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":12,"birth_year":1929,"name_first":"Alessandra","name_middle":null,"name_last":"Boehm","address_street1":"879 57 | Labadie Greens","address_street2":null,"address_city":"South Jalyn","address_subdivision":"VA","address_postal_code":"80373-0442","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:24 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_new/1_4_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Lee","name_last":"Cartwright","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":6,"birth_year":1987,"address_street1":"12622 9 | Carolanne Overpass","address_city":"Lake Gregory","address_subdivision":"LA","address_postal_code":"64966-8785","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"a86d0d9b92d3ffb66a877854d2fb77c5" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 64eab02a-4807-4faf-b365-43715007c035 40 | X-Runtime: 41 | - '0.275756' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:26 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbae34626100030000c5","created_at":1456462766,"updated_at":1456462766,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":6,"birth_year":1987,"name_first":"Lee","name_middle":null,"name_last":"Cartwright","address_street1":"12622 57 | Carolanne Overpass","address_street2":null,"address_city":"Lake Gregory","address_subdivision":"LA","address_postal_code":"64966-8785","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:27 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_new/1_4_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Myrl","name_last":"Bashirian","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":4,"birth_year":1933,"address_street1":"3877 9 | Carleton Mission","address_city":"Wendelltown","address_subdivision":"WY","address_postal_code":"84326","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"073aeeda718760e892d95fc261513dd5" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 0c15916e-db42-49a9-bd41-7d8e8713a1fd 40 | X-Runtime: 41 | - '0.264555' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:27 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbaf6237380003000114","created_at":1456462767,"updated_at":1456462767,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":4,"birth_year":1933,"name_first":"Myrl","name_middle":null,"name_last":"Bashirian","address_street1":"3877 57 | Carleton Mission","address_street2":null,"address_city":"Wendelltown","address_subdivision":"WY","address_postal_code":"84326","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:27 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_new/count/1_4_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Evalyn","name_last":"Homenick","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":2,"birth_year":1951,"address_street1":"2016 9 | Monroe Land","address_city":"Danielville","address_subdivision":"NC","address_postal_code":"18395-2255","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"49bf3ec7ce0c18cf0f76cc238b02fdc5" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - ec392c55-be8e-42c9-b1fb-d2fd74fe171c 40 | X-Runtime: 41 | - '0.260148' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:28 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb06237380003000115","created_at":1456462768,"updated_at":1456462768,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":2,"birth_year":1951,"name_first":"Evalyn","name_middle":null,"name_last":"Homenick","address_street1":"2016 57 | Monroe Land","address_street2":null,"address_city":"Danielville","address_subdivision":"NC","address_postal_code":"18395-2255","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:28 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_refresh/1_5_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Hilario","name_last":"McDermott","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":4,"birth_year":1980,"address_street1":"2872 9 | Altenwerth Groves","address_city":"Lake Fleta","address_subdivision":"UT","address_postal_code":"15389-0257","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"6179e5579f8315aa778b85878fe5fc09" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - d7a7a86d-4412-4771-a029-70e21c2fccd8 40 | X-Runtime: 41 | - '0.317707' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:25 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbad6237380003000112","created_at":1456462765,"updated_at":1456462765,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":4,"birth_year":1980,"name_first":"Hilario","name_middle":null,"name_last":"McDermott","address_street1":"2872 57 | Altenwerth Groves","address_street2":null,"address_city":"Lake Fleta","address_subdivision":"UT","address_postal_code":"15389-0257","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:25 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Collection/_refresh/1_5_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Elyse","name_last":"Jaskolski","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":6,"birth_year":1972,"address_street1":"369 9 | Heidenreich Spring","address_city":"Leohaven","address_subdivision":"CA","address_postal_code":"50907","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"567c6bc59e07ed4bc79db870e9360bfb" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 3d19c552-69ed-4a10-9b70-30d64bff4ec5 40 | X-Runtime: 41 | - '0.329836' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:26 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbad6237380003000113","created_at":1456462765,"updated_at":1456462765,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":6,"birth_year":1972,"name_first":"Elyse","name_middle":null,"name_last":"Jaskolski","address_street1":"369 57 | Heidenreich Spring","address_street2":null,"address_city":"Leohaven","address_subdivision":"CA","address_postal_code":"50907","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:26 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Company/_create/invalid_company/1_2_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/companies 6 | body: 7 | encoding: UTF-8 8 | string: '{"entity_name":"Koelpin-Kling","tax_id":"000000001","incorporation_country_code":"MK","incorporation_type":"sp","address_street1":"78855 9 | Isabel Street","address_city":"Lake Ottiston","address_subdivision":"VT","address_postal_code":"10457","address_country_code":"FI"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"b6a0d6650aa805644a37f0fb9745d6a6" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - b2637856-a47e-40e2-acd8-8633a2bd1c18 40 | X-Runtime: 41 | - '0.067466' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:11 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"company","id":"56cfdbdb6237380003000140","created_at":1456462811,"updated_at":1456462811,"status":"invalid","livemode":false,"entity_name":"Koelpin-Kling","tax_id":"000000001","incorporation_day":null,"incorporation_month":null,"incorporation_year":null,"incorporation_state":null,"incorporation_country_code":"MK","incorporation_type":"sp","dbas":null,"registration_number":null,"email":null,"url":null,"phone_number":null,"note":null,"ip_address":null,"address_street1":"78855 57 | Isabel Street","address_street2":null,"address_city":"Lake Ottiston","address_subdivision":"VT","address_postal_code":"10457","address_country_code":"FI","details":{"ofac":"no_match","tax_id":"match","entity_name":"mismatch","state":"no_match","address":"no_match","country_code":"no_match","incorp_date":"no_match"}}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:12 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Company/_create/invalid_company/1_2_2_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/companies 6 | body: 7 | encoding: UTF-8 8 | string: '{"entity_name":"Steuber, Schroeder and Schoen","tax_id":"000000001","incorporation_country_code":"SV","incorporation_type":"llc","address_street1":"33106 9 | Grace Freeway","address_city":"Rosenbaumtown","address_subdivision":"VT","address_postal_code":"76824-9024","address_country_code":"JP"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"b3223e4ae1c83b9c624df2920d82046f" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 5de247a6-fc30-44ba-bd83-d856d4a31eff 40 | X-Runtime: 41 | - '0.079669' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:11 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"company","id":"56cfdbdb65663600030000ce","created_at":1456462811,"updated_at":1456462811,"status":"invalid","livemode":false,"entity_name":"Steuber, 57 | Schroeder and Schoen","tax_id":"000000001","incorporation_day":null,"incorporation_month":null,"incorporation_year":null,"incorporation_state":null,"incorporation_country_code":"SV","incorporation_type":"llc","dbas":null,"registration_number":null,"email":null,"url":null,"phone_number":null,"note":null,"ip_address":null,"address_street1":"33106 58 | Grace Freeway","address_street2":null,"address_city":"Rosenbaumtown","address_subdivision":"VT","address_postal_code":"76824-9024","address_country_code":"JP","details":{"entity_name":"mismatch","tax_id":"match","state":"no_match","address":"no_match","country_code":"no_match","incorp_date":"no_match","ofac":"no_match"}}' 59 | http_version: 60 | recorded_at: Fri, 26 Feb 2016 05:00:11 GMT 61 | recorded_with: VCR 3.0.1 62 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Company/_create/valid_company/1_2_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/companies 6 | body: 7 | encoding: UTF-8 8 | string: '{"entity_name":"Ratke-Dibbert","tax_id":"000000000","incorporation_country_code":"KI","incorporation_type":"corporation","address_street1":"2728 9 | Nienow Landing","address_city":"Archport","address_subdivision":"LA","address_postal_code":"92238-1863","address_country_code":"KW"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"5919bf7feaf6dea01308aa500923367a" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - aa74bfb9-76ca-4e42-9f2a-15f1fb649583 40 | X-Runtime: 41 | - '0.065729' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:11 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"company","id":"56cfdbda623738000300013f","created_at":1456462810,"updated_at":1456462810,"status":"valid","livemode":false,"entity_name":"Ratke-Dibbert","tax_id":"000000000","incorporation_day":null,"incorporation_month":null,"incorporation_year":null,"incorporation_state":null,"incorporation_country_code":"KI","incorporation_type":"corporation","dbas":null,"registration_number":null,"email":null,"url":null,"phone_number":null,"note":null,"ip_address":null,"address_street1":"2728 57 | Nienow Landing","address_street2":null,"address_city":"Archport","address_subdivision":"LA","address_postal_code":"92238-1863","address_country_code":"KW","details":{"entity_name":"mismatch","tax_id":"match","state":"no_match","address":"no_match","country_code":"no_match","ofac":"no_match","incorp_date":"no_match"}}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:11 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Company/_create/valid_company/1_2_1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/companies 6 | body: 7 | encoding: UTF-8 8 | string: '{"entity_name":"Kuhic-Weissnat","tax_id":"000000000","incorporation_country_code":"IM","incorporation_type":"llc","address_street1":"9835 9 | Nathan Drives","address_city":"New Coleman","address_subdivision":"MT","address_postal_code":"85176-1167","address_country_code":"SM"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"bdad5ae0d56a9359c2f7cad049d4fabc" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - cff83c3a-b6ea-480b-8674-9276c673bb07 40 | X-Runtime: 41 | - '0.065035' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:10 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"company","id":"56cfdbda623738000300013e","created_at":1456462810,"updated_at":1456462810,"status":"valid","livemode":false,"entity_name":"Kuhic-Weissnat","tax_id":"000000000","incorporation_day":null,"incorporation_month":null,"incorporation_year":null,"incorporation_state":null,"incorporation_country_code":"IM","incorporation_type":"llc","dbas":null,"registration_number":null,"email":null,"url":null,"phone_number":null,"note":null,"ip_address":null,"address_street1":"9835 57 | Nathan Drives","address_street2":null,"address_city":"New Coleman","address_subdivision":"MT","address_postal_code":"85176-1167","address_country_code":"SM","details":{"entity_name":"mismatch","tax_id":"match","state":"no_match","address":"no_match","country_code":"no_match","ofac":"no_match","incorp_date":"no_match"}}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:10 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_InvalidRequestError/behaves_like_an_error/1_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"first_name":"John"}' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 400 19 | message: Bad Request 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Cache-Control: 34 | - no-cache 35 | X-Request-Id: 36 | - b8b4f1f8-8fe7-45c6-96ad-881b8351ca67 37 | X-Runtime: 38 | - '0.012045' 39 | Strict-Transport-Security: 40 | - max-age=31536000 41 | Date: 42 | - Fri, 26 Feb 2016 05:00:10 GMT 43 | X-Rack-Cache: 44 | - invalidate, pass 45 | Set-Cookie: 46 | - __profilin=p%3Dt; path=/ 47 | Transfer-Encoding: 48 | - chunked 49 | Via: 50 | - 1.1 vegur 51 | body: 52 | encoding: UTF-8 53 | string: '{"error":{"type":"invalid_request_error","param":"name_first","code":"cant_be_blank","message":"One 54 | or more required parameters are invalid"}}' 55 | http_version: 56 | recorded_at: Fri, 26 Feb 2016 05:00:10 GMT 57 | recorded_with: VCR 3.0.1 58 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_NotFoundError/behaves_like_an_error/1_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people/abc123 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | Accept: 11 | - application/vnd.blockscore+json;version=4 12 | User-Agent: 13 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 14 | Content-Type: 15 | - application/json 16 | response: 17 | status: 18 | code: 404 19 | message: Not Found 20 | headers: 21 | Server: 22 | - Cowboy 23 | Connection: 24 | - keep-alive 25 | X-Frame-Options: 26 | - SAMEORIGIN 27 | X-Xss-Protection: 28 | - 1; mode=block 29 | X-Content-Type-Options: 30 | - nosniff 31 | Content-Type: 32 | - application/json; charset=utf-8 33 | Cache-Control: 34 | - no-cache, private 35 | X-Request-Id: 36 | - af21086e-b9ea-487d-a07e-c5b5c7a042c6 37 | X-Runtime: 38 | - '0.007740' 39 | Strict-Transport-Security: 40 | - max-age=31536000 41 | Date: 42 | - Fri, 26 Feb 2016 04:58:47 GMT 43 | X-Rack-Cache: 44 | - miss 45 | Set-Cookie: 46 | - __profilin=p%3Dt; path=/ 47 | Transfer-Encoding: 48 | - chunked 49 | Via: 50 | - 1.1 vegur 51 | body: 52 | encoding: UTF-8 53 | string: '{"error":{"type":"invalid_request_error","message":"Person with id 54 | abc123 could not be found"}}' 55 | http_version: 56 | recorded_at: Fri, 26 Feb 2016 04:58:47 GMT 57 | recorded_with: VCR 3.0.1 58 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_create/invalid_person/1_2_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Hope","name_last":"Eichmann","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":5,"birth_year":1987,"address_street1":"106 9 | Corwin Forks","address_city":"Kendrickborough","address_subdivision":"DE","address_postal_code":"81858-6996","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"f948028120dd081e236638b7734e0b6c" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 153948fb-786a-4f4b-967f-bd97aa78b89c 40 | X-Runtime: 41 | - '0.273055' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:40 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbc6237380003000121","created_at":1456462780,"updated_at":1456462780,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":5,"birth_year":1987,"name_first":"Hope","name_middle":null,"name_last":"Eichmann","address_street1":"106 57 | Corwin Forks","address_street2":null,"address_city":"Kendrickborough","address_subdivision":"DE","address_postal_code":"81858-6996","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:40 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_create/invalid_person/1_2_2_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Johnson","name_last":"Schneider","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":8,"birth_year":1976,"address_street1":"48338 9 | Walsh Keys","address_city":"Port Lianaport","address_subdivision":"NJ","address_postal_code":"97445","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"3c69bb5a67b952d357b7ea7568038eff" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 9319a612-bb71-403d-b5bf-9b4aee1f7fc1 40 | X-Runtime: 41 | - '0.257226' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:41 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbd6237380003000122","created_at":1456462781,"updated_at":1456462781,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":8,"birth_year":1976,"name_first":"Johnson","name_middle":null,"name_last":"Schneider","address_street1":"48338 57 | Walsh Keys","address_street2":null,"address_city":"Port Lianaport","address_subdivision":"NJ","address_postal_code":"97445","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:41 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_create/valid_person/1_2_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Olen","name_last":"Lesch","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":4,"birth_year":1920,"address_street1":"73290 9 | Kelton Forge","address_city":"South Rico","address_subdivision":"WI","address_postal_code":"80210","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"2bd4ed26bb737285fe3ca0492f698721" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - d7029b9e-71a8-475c-a2d8-a0118453998f 40 | X-Runtime: 41 | - '0.286594' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:39 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbba34626100030000c7","created_at":1456462778,"updated_at":1456462778,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":4,"birth_year":1920,"name_first":"Olen","name_middle":null,"name_last":"Lesch","address_street1":"73290 57 | Kelton Forge","address_street2":null,"address_city":"South Rico","address_subdivision":"WI","address_postal_code":"80210","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:39 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_create/valid_person/1_2_1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Katharina","name_last":"Heidenreich","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":10,"birth_year":1985,"address_street1":"38199 9 | Estelle Corner","address_city":"Nitzschehaven","address_subdivision":"OK","address_postal_code":"71792","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e469ce8444c5a0e4d8039d35af67b19a" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - d17236fd-bac5-4e4d-a601-1ee16ad02b72 40 | X-Runtime: 41 | - '0.261981' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:39 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbb6237380003000120","created_at":1456462779,"updated_at":1456462779,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":10,"birth_year":1985,"name_first":"Katharina","name_middle":null,"name_last":"Heidenreich","address_street1":"38199 57 | Estelle Corner","address_street2":null,"address_city":"Nitzschehaven","address_subdivision":"OK","address_postal_code":"71792","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:39 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/invalid_person/1_4_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Alexandre","name_last":"Johnson","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":3,"birth_year":2012,"address_street1":"271 9 | Olson Turnpike","address_city":"Nicolasville","address_subdivision":"HI","address_postal_code":"60037-7155","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"a1a13d79592f0a96993f6f810e5254f2" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - fd945608-abc8-46df-9c78-93e6e6fd6251 40 | X-Runtime: 41 | - '0.258625' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:43 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbf6237380003000125","created_at":1456462783,"updated_at":1456462783,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":3,"birth_year":2012,"name_first":"Alexandre","name_middle":null,"name_last":"Johnson","address_street1":"271 57 | Olson Turnpike","address_street2":null,"address_city":"Nicolasville","address_subdivision":"HI","address_postal_code":"60037-7155","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:43 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/invalid_person/1_4_2_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Arvid","name_last":"Schimmel","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":4,"birth_year":1948,"address_street1":"88736 9 | Gail Camp","address_city":"Alexisfort","address_subdivision":"UT","address_postal_code":"35871","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"88a991db99499a4e47f7a1aca9ab4577" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 55911670-5396-4af7-9d2f-a87cc74eaf9a 40 | X-Runtime: 41 | - '0.275537' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:42 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbe6237380003000124","created_at":1456462782,"updated_at":1456462782,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":4,"birth_year":1948,"name_first":"Arvid","name_middle":null,"name_last":"Schimmel","address_street1":"88736 57 | Gail Camp","address_street2":null,"address_city":"Alexisfort","address_subdivision":"UT","address_postal_code":"35871","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:42 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/invalid_person/1_4_2_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Felicity","name_last":"Kozey","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":5,"birth_year":1926,"address_street1":"544 9 | Quigley Divide","address_city":"Kristianhaven","address_subdivision":"WA","address_postal_code":"80068","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"facf1c0ec8fbeb0e2af404e92defdab1" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 48f4bfcd-2a6b-49bc-9006-328af2eb3d8d 40 | X-Runtime: 41 | - '0.260356' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:42 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbd6237380003000123","created_at":1456462781,"updated_at":1456462781,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":5,"birth_year":1926,"name_first":"Felicity","name_middle":null,"name_last":"Kozey","address_street1":"544 57 | Quigley Divide","address_street2":null,"address_city":"Kristianhaven","address_subdivision":"WA","address_postal_code":"80068","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:42 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/valid_person/1_4_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Reece","name_last":"Brown","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":1,"birth_year":1994,"address_street1":"2564 9 | Stiedemann Light","address_city":"Port Araceli","address_subdivision":"UT","address_postal_code":"70261","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"4fa39c0671f9758280694ba8b73a9685" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 180f5a71-d40b-44a6-a395-bae24259afe9 40 | X-Runtime: 41 | - '0.269400' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:45 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbc16237380003000128","created_at":1456462785,"updated_at":1456462785,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":1,"birth_year":1994,"name_first":"Reece","name_middle":null,"name_last":"Brown","address_street1":"2564 57 | Stiedemann Light","address_street2":null,"address_city":"Port Araceli","address_subdivision":"UT","address_postal_code":"70261","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:45 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/valid_person/1_4_1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Enoch","name_last":"Volkman","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":10,"birth_year":1964,"address_street1":"8853 9 | Eriberto Camp","address_city":"Pollichport","address_subdivision":"IN","address_postal_code":"26304-9374","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e4a6844002682eaffcec553a23080af4" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 4b7616df-0137-4e6e-87f3-44ed2f786e40 40 | X-Runtime: 41 | - '0.283266' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:44 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbc06237380003000127","created_at":1456462784,"updated_at":1456462784,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":10,"birth_year":1964,"name_first":"Enoch","name_middle":null,"name_last":"Volkman","address_street1":"8853 57 | Eriberto Camp","address_street2":null,"address_city":"Pollichport","address_subdivision":"IN","address_postal_code":"26304-9374","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:44 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_invalid_/valid_person/1_4_1_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Pauline","name_last":"Robel","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":8,"birth_year":1921,"address_street1":"85361 9 | Adeline Mountains","address_city":"Hansenfurt","address_subdivision":"MO","address_postal_code":"50963-9379","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"5d5dbcac958720b9a4a05d09f5e22d93" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 9d99ed81-efe7-449b-8810-bddfadb82ebf 40 | X-Runtime: 41 | - '0.260681' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:44 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbbf6237380003000126","created_at":1456462783,"updated_at":1456462783,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":8,"birth_year":1921,"name_first":"Pauline","name_middle":null,"name_last":"Robel","address_street1":"85361 57 | Adeline Mountains","address_street2":null,"address_city":"Hansenfurt","address_subdivision":"MO","address_postal_code":"50963-9379","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:44 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/invalid_person/1_3_2_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Lloyd","name_last":"Cremin","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":9,"birth_year":1986,"address_street1":"2352 9 | Jalen Roads","address_city":"Hanefurt","address_subdivision":"SD","address_postal_code":"88134-5568","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"3707f58ca183a9560c80b790df4440d9" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 9fce1205-669e-478a-beed-1a782bfa47c2 40 | X-Runtime: 41 | - '0.252731' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:36 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb8623738000300011d","created_at":1456462776,"updated_at":1456462776,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":9,"birth_year":1986,"name_first":"Lloyd","name_middle":null,"name_last":"Cremin","address_street1":"2352 57 | Jalen Roads","address_street2":null,"address_city":"Hanefurt","address_subdivision":"SD","address_postal_code":"88134-5568","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:36 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/invalid_person/1_3_2_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Olin","name_last":"Roob","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":6,"birth_year":1984,"address_street1":"297 9 | Collins Road","address_city":"East Deeton","address_subdivision":"NE","address_postal_code":"89955","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e5db919d3eac8cb00b7077b0ed1b6be6" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 53fe150e-9385-459c-9cb8-c06a6713a359 40 | X-Runtime: 41 | - '0.280285' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:35 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb6623738000300011c","created_at":1456462774,"updated_at":1456462774,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":6,"birth_year":1984,"name_first":"Olin","name_middle":null,"name_last":"Roob","address_street1":"297 57 | Collins Road","address_street2":null,"address_city":"East Deeton","address_subdivision":"NE","address_postal_code":"89955","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:35 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/invalid_person/1_3_2_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Lukas","name_last":"VonRueden","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":1,"birth_year":1986,"address_street1":"8920 9 | Pfeffer Mountains","address_city":"North Leonardton","address_subdivision":"AZ","address_postal_code":"36786","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"ab7075a3a2c7748561ffdd662cbf35f0" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 0a0309ba-ff92-457d-84b6-8752e0324e3a 40 | X-Runtime: 41 | - '0.273188' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:35 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb734626100030000c6","created_at":1456462775,"updated_at":1456462775,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":1,"birth_year":1986,"name_first":"Lukas","name_middle":null,"name_last":"VonRueden","address_street1":"8920 57 | Pfeffer Mountains","address_street2":null,"address_city":"North Leonardton","address_subdivision":"AZ","address_postal_code":"36786","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:35 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/valid_person/1_3_1_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Pat","name_last":"Murphy","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":8,"birth_year":1958,"address_street1":"496 9 | Dooley Ports","address_city":"South Ellietown","address_subdivision":"TX","address_postal_code":"29470","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"e998091f7ebec1e9304a1b76836a984c" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 66c45e79-ea64-4ab7-9720-d165546dba97 40 | X-Runtime: 41 | - '0.269252' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:37 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb9623738000300011e","created_at":1456462777,"updated_at":1456462777,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":8,"birth_year":1958,"name_first":"Pat","name_middle":null,"name_last":"Murphy","address_street1":"496 57 | Dooley Ports","address_street2":null,"address_city":"South Ellietown","address_subdivision":"TX","address_postal_code":"29470","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:37 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/valid_person/1_3_1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Ryan","name_last":"Lubowitz","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":12,"birth_year":1939,"address_street1":"174 9 | Schmitt Forges","address_city":"Jonfurt","address_subdivision":"WY","address_postal_code":"81853","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"31d448e406651f070c76bd6d22bb48ef" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 88ad0806-dfb4-440b-a0e4-eaa81d358e61 40 | X-Runtime: 41 | - '0.280258' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:37 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbb836636100030000b2","created_at":1456462776,"updated_at":1456462776,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":12,"birth_year":1939,"name_first":"Ryan","name_middle":null,"name_last":"Lubowitz","address_street1":"174 57 | Schmitt Forges","address_street2":null,"address_city":"Jonfurt","address_subdivision":"WY","address_postal_code":"81853","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:37 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_Person/_valid_/valid_person/1_3_1_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Eleazar","name_last":"Metz","document_type":"ssn","document_value":"0000","birth_day":12,"birth_month":1,"birth_year":1923,"address_street1":"710 9 | Watsica Plain","address_city":"Bergeburgh","address_subdivision":"AZ","address_postal_code":"78360","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"889d331b2347737c108cf551d3c1a144" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - f1e2b3cc-c0c9-40b9-9a95-b21d19ce3abb 40 | X-Runtime: 41 | - '0.256499' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 04:59:38 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbba623738000300011f","created_at":1456462778,"updated_at":1456462778,"status":"valid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":1,"birth_year":1923,"name_first":"Eleazar","name_middle":null,"name_last":"Metz","address_street1":"710 57 | Watsica Plain","address_street2":null,"address_city":"Bergeburgh","address_subdivision":"AZ","address_postal_code":"78360","address_country_code":"US","document_type":"ssn","document_value":"0000","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 04:59:38 GMT 60 | recorded_with: VCR 3.0.1 61 | -------------------------------------------------------------------------------- /spec/cassettes/BlockScore_QuestionSet/_create/invalid_person/is_an_invalid_request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/people 6 | body: 7 | encoding: UTF-8 8 | string: '{"name_first":"Malvina","name_last":"Watsica","document_type":"ssn","document_value":"0001","birth_day":12,"birth_month":12,"birth_year":1990,"address_street1":"74698 9 | Mosciski Mill","address_city":"New Lea","address_subdivision":"TN","address_postal_code":"84090","address_country_code":"US"}' 10 | headers: 11 | Accept: 12 | - application/vnd.blockscore+json;version=4 13 | User-Agent: 14 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 15 | Content-Type: 16 | - application/json 17 | response: 18 | status: 19 | code: 201 20 | message: Created 21 | headers: 22 | Server: 23 | - Cowboy 24 | Connection: 25 | - keep-alive 26 | X-Frame-Options: 27 | - SAMEORIGIN 28 | X-Xss-Protection: 29 | - 1; mode=block 30 | X-Content-Type-Options: 31 | - nosniff 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Etag: 35 | - W/"48768f4a7c3895fc54f8d9a7ad381e3f" 36 | Cache-Control: 37 | - max-age=0, private, must-revalidate 38 | X-Request-Id: 39 | - 4423e61a-c4b9-4eda-a3ff-e277a363ce7f 40 | X-Runtime: 41 | - '0.260492' 42 | Strict-Transport-Security: 43 | - max-age=31536000 44 | Date: 45 | - Fri, 26 Feb 2016 05:00:18 GMT 46 | X-Rack-Cache: 47 | - invalidate, pass 48 | Set-Cookie: 49 | - __profilin=p%3Dt; path=/ 50 | Transfer-Encoding: 51 | - chunked 52 | Via: 53 | - 1.1 vegur 54 | body: 55 | encoding: UTF-8 56 | string: '{"object":"person","id":"56cfdbe26237380003000147","created_at":1456462818,"updated_at":1456462818,"status":"invalid","livemode":false,"phone_number":null,"ip_address":null,"birth_day":12,"birth_month":12,"birth_year":1990,"name_first":"Malvina","name_middle":null,"name_last":"Watsica","address_street1":"74698 57 | Mosciski Mill","address_street2":null,"address_city":"New Lea","address_subdivision":"TN","address_postal_code":"84090","address_country_code":"US","document_type":"ssn","document_value":"0001","note":null,"details":{"address":"no_match","address_risk":"low","identification":"no_match","date_of_birth":"not_found","ofac":"no_match","pep":"no_match"},"question_sets":[]}' 58 | http_version: 59 | recorded_at: Fri, 26 Feb 2016 05:00:18 GMT 60 | - request: 61 | method: post 62 | uri: https://BLOCKSCORE_TEST_KEY:@api.blockscore.com/question_sets 63 | body: 64 | encoding: UTF-8 65 | string: '{"person_id":"56cfdbe26237380003000147"}' 66 | headers: 67 | Accept: 68 | - application/vnd.blockscore+json;version=4 69 | User-Agent: 70 | - blockscore-ruby/4.2.1 (https://github.com/BlockScore/blockscore-ruby) 71 | Content-Type: 72 | - application/json 73 | response: 74 | status: 75 | code: 400 76 | message: Bad Request 77 | headers: 78 | Server: 79 | - Cowboy 80 | Connection: 81 | - keep-alive 82 | X-Frame-Options: 83 | - SAMEORIGIN 84 | X-Xss-Protection: 85 | - 1; mode=block 86 | X-Content-Type-Options: 87 | - nosniff 88 | Content-Type: 89 | - application/json; charset=utf-8 90 | Cache-Control: 91 | - no-cache 92 | X-Request-Id: 93 | - e3acd87d-43d8-4e0a-b80b-cd2dab157f77 94 | X-Runtime: 95 | - '0.037666' 96 | Strict-Transport-Security: 97 | - max-age=31536000 98 | Date: 99 | - Fri, 26 Feb 2016 05:00:19 GMT 100 | X-Rack-Cache: 101 | - invalidate, pass 102 | Transfer-Encoding: 103 | - chunked 104 | Via: 105 | - 1.1 vegur 106 | body: 107 | encoding: UTF-8 108 | string: '{"error":{"type":"invalid_request_error","message":"Id verification 109 | can''t be invalid"}}' 110 | http_version: 111 | recorded_at: Fri, 26 Feb 2016 05:00:19 GMT 112 | recorded_with: VCR 3.0.1 113 | -------------------------------------------------------------------------------- /spec/factories/candidates.rb: -------------------------------------------------------------------------------- 1 | require 'factory_girl' 2 | require 'faker' 3 | 4 | FactoryGirl.define do 5 | factory :candidate, class: 'BlockScore::Candidate' do 6 | ssn { '0000' } 7 | date_of_birth { Faker::Date.backward(365 * 100).to_s } 8 | name_first { Faker::Name.first_name } 9 | name_last { Faker::Name.last_name } 10 | address_street1 { Faker::Address.street_address } 11 | address_city { Faker::Address.city } 12 | address_country_code { Faker::Address.country_code } 13 | 14 | # TODO: Update to use '0010' AND style option set 15 | trait :watched_person do 16 | ssn { nil } 17 | date_of_birth { nil } 18 | name_first { 'John' } 19 | name_last { 'Bredenkamp' } 20 | address_street1 { nil } 21 | address_city { nil } 22 | address_country_code { nil } 23 | end 24 | 25 | factory :watched_person_candidate, traits: [:watched_person] 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /spec/factories/companies.rb: -------------------------------------------------------------------------------- 1 | require 'factory_girl' 2 | require 'faker' 3 | 4 | FactoryGirl.define do 5 | factory :company, class: 'BlockScore::Company' do 6 | entity_name { Faker::Company.name } 7 | tax_id { '000000000' } 8 | incorporation_country_code { Faker::Address.country_code } 9 | incorporation_type do 10 | %w(corporation llc partnership sp other).sample 11 | end 12 | address_street1 { Faker::Address.street_address } 13 | address_city { Faker::Address.city } 14 | address_subdivision { Faker::Address.state_abbr } 15 | address_postal_code { Faker::Address.postcode } 16 | address_country_code { Faker::Address.country_code } 17 | 18 | trait :invalid do 19 | tax_id { '000000001' } 20 | end 21 | 22 | factory :valid_company 23 | factory :invalid_company, traits: [:invalid] 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/factories/people.rb: -------------------------------------------------------------------------------- 1 | require 'factory_girl' 2 | require 'faker' 3 | 4 | FactoryGirl.define do 5 | factory :person, class: 'BlockScore::Person' do 6 | name_first { Faker::Name.first_name } 7 | name_last { Faker::Name.last_name } 8 | document_type { 'ssn' } 9 | document_value { '0000' } 10 | birth_day { 12 } 11 | birth_month { Faker::Date.backward(365 * 100).month } 12 | birth_year { Faker::Date.backward(365 * 100).year } 13 | address_street1 { Faker::Address.street_address } 14 | address_city { Faker::Address.city } 15 | address_subdivision { Faker::Address.state_abbr } 16 | address_postal_code { Faker::Address.postcode } 17 | address_country_code { 'US' } 18 | 19 | trait :invalid do 20 | document_value { '0001' } 21 | end 22 | 23 | factory :valid_person 24 | factory :invalid_person, traits: [:invalid] 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/factories/question_sets.rb: -------------------------------------------------------------------------------- 1 | require 'factory_girl' 2 | require 'faker' 3 | 4 | FactoryGirl.define do 5 | factory :question_set, class: 'BlockScore::QuestionSet' do 6 | person_id { create(:valid_person).id } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/spec.rb: -------------------------------------------------------------------------------- 1 | # Consolidate spec setup and don't pollute global namespace 2 | module BlockScore 3 | module Spec 4 | SPEC = File.expand_path('..', __FILE__).freeze 5 | 6 | module_function 7 | 8 | # Setup specs 9 | # 10 | # load in support directory helpers, init webmock, and init factory girl 11 | # 12 | # @return [undefined] 13 | # 14 | # @api public 15 | def setup 16 | load_support 17 | setup_factory_girl 18 | end 19 | 20 | def setup_factory_girl 21 | FactoryGirl.reload 22 | end 23 | 24 | def load_support 25 | Dir[SPEC + '/support/**/*.rb'].each { |path| require(path) } 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'codeclimate-test-reporter' 2 | SimpleCov.start do 3 | add_filter '/spec/' 4 | 5 | formatter SimpleCov::Formatter::MultiFormatter[ 6 | SimpleCov::Formatter::HTMLFormatter, 7 | CodeClimate::TestReporter::Formatter 8 | ] 9 | end 10 | 11 | require 'dotenv' 12 | Dotenv.load 13 | 14 | require 'blockscore' 15 | require 'timeout' 16 | require 'vcr_setup' 17 | require 'factory_girl' 18 | require 'webmock' 19 | require 'webmock/rspec' 20 | require 'rspec' 21 | require 'rspec/its' 22 | 23 | BlockScore::Spec.setup 24 | 25 | module BlockScore 26 | RSpec.configure do |config| 27 | config.include(FactoryGirl::Syntax::Methods) 28 | 29 | config.expect_with :rspec do |expectations| 30 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 31 | end 32 | 33 | config.mock_with :rspec do |mocks| 34 | mocks.verify_partial_doubles = true 35 | end 36 | 37 | config.filter_run :focus 38 | config.run_all_when_everything_filtered = true 39 | config.example_status_persistence_file_path = 'spec/.rspec-state' 40 | config.disable_monkey_patching! 41 | config.warnings = true 42 | 43 | config.default_formatter = 'doc' if config.files_to_run.one? 44 | 45 | config.profile_examples = 10 46 | 47 | config.order = :random 48 | Kernel.srand config.seed 49 | 50 | config.around do |example| 51 | Timeout.timeout(6, &example) 52 | end 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /spec/support/api_request_behavior.rb: -------------------------------------------------------------------------------- 1 | module BlockScore 2 | RSpec.shared_context 'api request' do 3 | let(:base_url) { "https://#{Spec::API_KEY}:@api.blockscore.com" } 4 | let(:url) { base_url + uri } 5 | let(:_expected) { respond_to?(:expected) ? expected : { body: {} } } 6 | subject(:request) { a_request(http_method, url).with(_expected) } 7 | 8 | it { should have_been_made } 9 | end 10 | 11 | %w(get post patch delete).each do |verb| 12 | RSpec.shared_context verb.upcase do 13 | let(:http_method) { verb.to_sym } 14 | 15 | include_context 'api request' 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/support/error_behavior.rb: -------------------------------------------------------------------------------- 1 | RSpec.shared_context 'an error' do 2 | it do 3 | expect { subject }.to raise_error do |raised| 4 | expect(raised).to be_an_instance_of(described_class) 5 | expect(raised.message).to eql(message) 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/support/included_class_methods.rb: -------------------------------------------------------------------------------- 1 | RSpec.shared_context 'included class methods' do 2 | describe '.included' do 3 | subject { object } 4 | let(:object) { described_class } 5 | let(:klass) { Class.new } 6 | 7 | it 'extends the klass' do 8 | expect(klass.singleton_class) 9 | .not_to include(described_class::ClassMethods) 10 | klass.send(:include, subject) 11 | expect(klass.singleton_class) 12 | .to include(described_class::ClassMethods) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/support/question_set_helper.rb: -------------------------------------------------------------------------------- 1 | module QuestionSetHelper 2 | VALID_ANSWERS = [ 3 | '309 Colver Rd'.freeze, 4 | '812'.freeze, 5 | 'Jasper'.freeze, 6 | '49230'.freeze, 7 | 'None Of The Above'.freeze 8 | ].freeze 9 | 10 | def self.correct_answers(questions) 11 | answers(questions, true) 12 | end 13 | 14 | def self.incorrect_answers(questions) 15 | answers(questions, false) 16 | end 17 | 18 | def self.answers(questions, correct = true) 19 | selected_answers = [] 20 | 21 | questions.each do |question| 22 | question.answers.each do |answer| 23 | next unless VALID_ANSWERS.include? answer.answer 24 | 25 | selected_answers << { 26 | question_id: question.id, 27 | answer_id: (correct ? answer.id : (answer.id + 1) % 5) 28 | } 29 | break 30 | end 31 | end 32 | selected_answers 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /spec/support/vcr_helper.rb: -------------------------------------------------------------------------------- 1 | module VCRHelper 2 | def self.spinlock_until(retries: 30) 3 | retries.times do 4 | return if yield 5 | sleep(1) 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/all_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::All, vcr: true do 4 | describe '.all' do 5 | let(:uniq_token_one) { '4a2c019a1e3c33442644d9f52c7a93f7' } 6 | let(:uniq_token_two) { 'ba9a680671c6c006c6105aa450837668' } 7 | let!(:p1) { create(:person, name_first: 'John', name_last: uniq_token_one) } 8 | let!(:p2) { create(:person, name_first: 'John', name_last: uniq_token_two) } 9 | subject(:people) { BlockScore::Person.all } 10 | 11 | it { is_expected.not_to be_empty } 12 | it { expect(people[0].name_last).to eql uniq_token_two } 13 | it { expect(people[1].name_last).to eql uniq_token_one } 14 | 15 | context 'invalid filter parameter' do 16 | let(:expectation) do 17 | '(Type: invalid_request_error) ' \ 18 | 'Received unknown filter parameter: name_second (name_second) ' \ 19 | '(Status: 400)' 20 | end 21 | it 'returns an error if filter parameter not in list' do 22 | expect { BlockScore::Person.all('filter[name_second]' => 'valid') } 23 | .to raise_error(BlockScore::InvalidRequestError, expectation) 24 | end 25 | end 26 | 27 | context 'invalid comparison operator' do 28 | let(:expectation) do 29 | '(Type: invalid_request_error) ' \ 30 | 'Received unknown filter directive: gtx (gtx) ' \ 31 | '(Status: 400)' 32 | end 33 | it 'returns an error if comparison operator not in allowed list' do 34 | expect { BlockScore::Person.all('created_at[gtx]' => 1_455_660_769) } 35 | .to raise_error(BlockScore::InvalidRequestError, expectation) 36 | end 37 | end 38 | end 39 | 40 | it_behaves_like 'included class methods' 41 | end 42 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/create_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::Create, vcr: true do 4 | describe '.create' do 5 | subject(:candidate) do 6 | BlockScore::Candidate.create(attributes_for(:candidate)) 7 | end 8 | 9 | it { is_expected.to be_persisted } 10 | it { is_expected.to be_an_instance_of BlockScore::Candidate } 11 | end 12 | 13 | it_behaves_like 'included class methods' 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/delete_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::Delete, vcr: true do 4 | describe '#delete' do 5 | subject(:candidate) { create(:candidate) } 6 | before do 7 | expect(candidate.delete).to be true 8 | end 9 | 10 | its(:persisted?) { is_expected.to be false } 11 | its(:deleted?) { is_expected.to be true } 12 | 13 | context 'previously deleted' do 14 | it 'was already deleted' do 15 | expect(candidate.delete).to be false 16 | end 17 | end 18 | end 19 | 20 | describe '#delete!' do 21 | subject(:candidate) { create(:candidate) } 22 | before do 23 | expect(BlockScore::Candidate) 24 | .to receive(:delete) 25 | .with(kind_of(Pathname), {}) 26 | .and_call_original 27 | 28 | expect(candidate.delete!).to be true 29 | end 30 | 31 | its(:persisted?) { is_expected.to be false } 32 | its(:deleted?) { is_expected.to be true } 33 | 34 | context 'previously deleted' do 35 | it 'was already deleted' do 36 | expect { candidate.delete! } 37 | .to raise_error(BlockScore::Error, 38 | 'candidate is already deleted') 39 | end 40 | end 41 | end 42 | 43 | describe '#delete!' do 44 | subject(:candidate) { create(:candidate) } 45 | before do 46 | expect(BlockScore::Candidate) 47 | .to receive(:delete) 48 | .with(kind_of(Pathname), {}) 49 | .and_call_original 50 | 51 | candidate.delete 52 | end 53 | it { is_expected.not_to be_persisted } 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/retrieve_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::Retrieve, vcr: true do 4 | describe '.retrieve' do 5 | let(:person_id) { create(:person).id } 6 | subject(:person) { BlockScore::Person.retrieve(person_id) } 7 | 8 | it { is_expected.to be_persisted } 9 | its(:name_first) { is_expected.not_to be_empty } 10 | it { is_expected.to be_an_instance_of BlockScore::Person } 11 | 12 | it 'must supply an ID' do 13 | expect { BlockScore::Person.retrieve(nil) } 14 | .to raise_error(ArgumentError, 'ID must be supplied') 15 | expect { BlockScore::Person.retrieve('') } 16 | .to raise_error(ArgumentError, 'ID must be supplied') 17 | end 18 | 19 | context 'Malformed ID presented' do 20 | let(:person_id) { 'ABC&&234' } 21 | 22 | it 'must have a properly formed ID' do 23 | expect { BlockScore::Person.retrieve(person_id) } 24 | .to raise_error(ArgumentError, 'ID is malformed') 25 | end 26 | end 27 | end 28 | 29 | it_behaves_like 'included class methods' 30 | end 31 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/update_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::Update, vcr: true do 4 | describe '#save!' do 5 | subject(:candidate) { build(:candidate, name_first: 'John') } 6 | 7 | context 'when changing first update candidate' do 8 | it 'has the same attributes' do 9 | expect(candidate.persisted?).to be false 10 | expect(candidate.save!).to be true 11 | 12 | expect(candidate.persisted?).to be true 13 | 14 | candidate.name_first = 'Janie' 15 | expect(candidate) 16 | .to receive(:patch) 17 | .with(kind_of(Pathname), 18 | hash_including(name_first: 'Janie')) 19 | .and_call_original 20 | 21 | expect { expect(candidate.save!).to be(true) } 22 | .not_to change(candidate, :id) 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/unit/block_score/actions/write_once_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Actions::WriteOnce, vcr: true do 4 | describe '#save!' do 5 | context 'when creating a new person' do 6 | subject(:person) { build(:person) } 7 | before { person.save! } 8 | 9 | it { is_expected.to be_persisted } 10 | its(:name_first) { is_expected.not_to be_empty } 11 | end 12 | 13 | context 'when updating an existing person' do 14 | subject(:person) { create(:person, name_first: 'John') } 15 | 16 | it 'prevents saving' do 17 | expect(person.persisted?).to be true 18 | expect { person.save! } 19 | .to raise_error(BlockScore::Error, 'person is immutable once saved') 20 | end 21 | end 22 | end 23 | 24 | context 'object is immutable' do 25 | subject(:person) { build(:person, name_first: 'John') } 26 | 27 | it 'prevents alteration' do 28 | person.save! 29 | 30 | expect { person.bad = 'Jane' } 31 | .to raise_error(BlockScore::Error, 'person is immutable once saved') 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /spec/unit/block_score/api_connection_error_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::APIConnectionError, vcr: true do 2 | let(:stubbed_route_pattern) { %r{.*api\.blockscore\.com/people/abc123} } 3 | let(:stubbed_error) { Errno::ECONNREFUSED } 4 | let(:message) { 'Connection refused - Exception from WebMock' } 5 | subject { BlockScore::Person.retrieve('abc123') } 6 | 7 | before { stub_request(:get, stubbed_route_pattern).to_raise(stubbed_error) } 8 | 9 | it_behaves_like 'an error' 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/block_score/collection/member_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::Collection::Member, vcr: true do 2 | describe '#save' do 3 | let(:question_set) { BlockScore::QuestionSet.new } 4 | subject(:member) { described_class.new(person, question_set) } 5 | 6 | context 'unsaved person' do 7 | let(:person) { BlockScore::Person.new(attributes_for(:person)) } 8 | 9 | it 'saves the person as part of member save' do 10 | expect(person).not_to be_persisted 11 | expect(member.save).to be true 12 | expect(person).to be_persisted 13 | end 14 | end 15 | 16 | context 'previously saved person' do 17 | let(:person) { BlockScore::Person.create(attributes_for(:person)) } 18 | 19 | it 'contains the proper fields' do 20 | expect(member.save).to be true 21 | expect(person).to be_persisted 22 | expect(person.attributes.fetch(:question_sets)) 23 | .to eql([question_set.id]) 24 | expect(member).to be_an_instance_of described_class 25 | expect(member.person_id).to eql person.id 26 | 27 | member.save 28 | expect(person.attributes.fetch(:question_sets)) 29 | .to eql([question_set.id]) 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /spec/unit/block_score/collection_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::Collection, vcr: true do 2 | let(:person) { create(:person) } 3 | subject(:question_sets) { person.question_sets } 4 | 5 | it { is_expected.to be_empty } 6 | it { is_expected.to be_an_instance_of described_class } 7 | 8 | describe '#all' do 9 | it { is_expected.to be_empty } 10 | it { expect(question_sets).to be_an_instance_of described_class } 11 | end 12 | 13 | describe '#new' do 14 | before { question_sets.new } 15 | 16 | it { is_expected.not_to be_empty } 17 | its(:count) { should be 1 } 18 | it { is_expected.to be_an_instance_of described_class } 19 | end 20 | 21 | describe '#refresh' do 22 | before do 23 | question_sets.new 24 | question_sets.new 25 | question_sets.refresh 26 | end 27 | 28 | it { is_expected.to be_empty } 29 | it { is_expected.to be_an_instance_of described_class } 30 | end 31 | 32 | describe '#create' do 33 | before { question_sets.create } 34 | 35 | it { is_expected.not_to be_empty } 36 | its(:count) { should be 1 } 37 | it { is_expected.to be_an_instance_of described_class } 38 | end 39 | 40 | describe '#retrieve' do 41 | let(:question_set_id) { create(:question_set, person_id: person.id).id } 42 | let(:question_set_id2) { create(:question_set, person_id: person.id).id } 43 | 44 | it 'is the proper class' do 45 | expect(question_sets.retrieve(question_set_id)) 46 | .to be_an_instance_of BlockScore::Collection::Member 47 | 48 | # prove retrieving same question set is not duplicating in cache 49 | question_sets.retrieve(question_set_id) 50 | expect(question_sets.count).to be(1) 51 | 52 | expect(question_sets.retrieve(question_set_id2)) 53 | .to be_an_instance_of BlockScore::Collection::Member 54 | expect(question_sets.retrieve(question_set_id2).id) 55 | .to eql question_set_id2.dup 56 | expect(question_sets.count).to be(2) 57 | end 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /spec/unit/block_score/company_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::Company, vcr: true do 2 | describe '.new' do 3 | subject(:company) { described_class.new(attributes_for(:company)) } 4 | 5 | it { is_expected.not_to be_persisted } 6 | it { is_expected.to be_an_instance_of described_class } 7 | end 8 | 9 | describe '.create' do 10 | context 'valid company' do 11 | subject(:company) { described_class.create(attributes_for(:company)) } 12 | 13 | it { is_expected.to be_persisted } 14 | it { is_expected.to be_an_instance_of described_class } 15 | end 16 | 17 | context 'invalid company' do 18 | subject(:company) { described_class.create(attributes_for(:invalid_company)) } 19 | 20 | it { is_expected.to be_persisted } 21 | it { is_expected.to be_an_instance_of described_class } 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/unit/block_score/connection_spec.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | RSpec.describe BlockScore::Connection do 4 | before do 5 | BlockScore.api_key = ENV.fetch(BlockScore::ENVIRONMENT_API_KEY, 6 | BlockScore::PLACEHOLDER_API_KEY) 7 | end 8 | 9 | describe 'general' do 10 | subject(:company) { BlockScore::Company.create(attributes_for(:company)) } 11 | 12 | context 'no api key' do 13 | it 'provided no api key' do 14 | BlockScore.api_key = false 15 | expect { company } 16 | .to raise_error(BlockScore::NoAPIKeyError, 'No API key was provided.') 17 | end 18 | end 19 | 20 | context 'no socket' do 21 | it 'raises socketerror' do 22 | allow(BlockScore::Company) 23 | .to receive(:execute_request).and_raise(SocketError) 24 | expect { company } 25 | .to raise_error(BlockScore::APIConnectionError, 'SocketError') 26 | end 27 | 28 | it 'raises Errno::ECONNREFUSED' do 29 | allow(BlockScore::Company) 30 | .to receive(:execute_request).and_raise(Errno::ECONNREFUSED) 31 | expect { company } 32 | .to raise_error(BlockScore::APIConnectionError, 'Connection refused') 33 | end 34 | end 35 | 36 | context 'normal request' do 37 | it 'creates the company using :post' do 38 | expect(BlockScore::Company.create(attributes_for(:company))) 39 | .to be_an_instance_of(BlockScore::Company) 40 | end 41 | 42 | it 'retrieves no persons using :get' do 43 | expect(BlockScore::Person.all('filter[status]' => 'unknown')) 44 | .to be_empty 45 | end 46 | 47 | it 'retrieves the persons' do 48 | expect(BlockScore::Person.all('filter[name_middle]' => nil)) 49 | .not_to be_empty 50 | end 51 | end 52 | end 53 | 54 | describe '#delete' do 55 | subject(:candidate) { create(:candidate) } 56 | before do 57 | candidate.delete 58 | end 59 | 60 | it { is_expected.not_to be_persisted } 61 | it { expect(candidate.deleted).to be true } 62 | it 'has the deleted attributes' do 63 | expect(BlockScore::Candidate.retrieve(candidate.id).deleted).to be true 64 | end 65 | end 66 | 67 | describe '#patch' do 68 | subject(:candidate) { create(:candidate, name_first: 'John') } 69 | before do 70 | expect(candidate.persisted?).to be true 71 | candidate.name_first = 'Janie' 72 | expect(candidate.save!).to be true 73 | 74 | candidate.name_first = 'Jane' 75 | expect(candidate.save!).to be true 76 | end 77 | 78 | it 'has the same attributes' do 79 | expect(BlockScore::Candidate 80 | .retrieve(candidate.id) 81 | .attributes.reject { |key, _| key.equal?(:updated_at) }) 82 | .to eql candidate.attributes.reject { |key, _| key.equal?(:updated_at) } 83 | end 84 | end 85 | 86 | describe '#post' do 87 | subject(:candidate) { build(:candidate, name_first: 'John') } 88 | 89 | it 'has the same attributes' do 90 | candidate.save! 91 | 92 | refreshed_candidate = BlockScore::Candidate.retrieve(candidate.id) 93 | expect(refreshed_candidate.name_first).to eql 'John' 94 | expect(refreshed_candidate.attributes).to eql candidate.attributes 95 | end 96 | end 97 | end 98 | -------------------------------------------------------------------------------- /spec/unit/block_score/invalid_request_error_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::InvalidRequestError, vcr: true do 2 | subject { BlockScore::Person.create(first_name: 'John') } 3 | let(:message) do 4 | '(Type: invalid_request_error) ' \ 5 | 'One or more required parameters are invalid (name_first) (Status: 400)' 6 | end 7 | 8 | it_behaves_like 'an error' 9 | end 10 | -------------------------------------------------------------------------------- /spec/unit/block_score/not_found_error_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::NotFoundError, vcr: true do 2 | subject { BlockScore::Person.retrieve('abc123') } 3 | let(:message) do 4 | '(Type: invalid_request_error) ' \ 5 | 'Person with id abc123 could not be found (Status: 404)' 6 | end 7 | 8 | it_behaves_like 'an error' 9 | end 10 | -------------------------------------------------------------------------------- /spec/unit/block_score/person_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::Person, vcr: true do 2 | describe '.new' do 3 | subject(:person) { described_class.new(attributes_for(:person)) } 4 | 5 | it { is_expected.not_to be_persisted } 6 | it { is_expected.to be_an_instance_of described_class } 7 | 8 | it 'creates question sets collection' do 9 | expect(person.question_sets).to be_an_instance_of BlockScore::Collection 10 | end 11 | 12 | it 'has a question_set with proper member_class' do 13 | expect(person.question_sets.new).to be_an_instance_of BlockScore::Collection::Member 14 | end 15 | 16 | it 'is setup from the options provided' do 17 | expect(person.name_first).not_to be_empty 18 | end 19 | end 20 | 21 | describe '.create' do 22 | context 'valid person' do 23 | subject(:person) { described_class.create(attributes_for(:person)) } 24 | 25 | it { is_expected.to be_persisted } 26 | it { is_expected.to be_an_instance_of described_class } 27 | end 28 | 29 | context 'invalid person' do 30 | subject(:person) do 31 | described_class.create(attributes_for(:invalid_person)) 32 | end 33 | 34 | it { is_expected.to be_persisted } 35 | it { is_expected.to be_an_instance_of described_class } 36 | end 37 | end 38 | 39 | describe '#valid?' do 40 | context 'valid person' do 41 | subject(:person) { create(:valid_person) } 42 | 43 | it { is_expected.to be_persisted } 44 | it { is_expected.to be_valid } 45 | it { is_expected.to be_an_instance_of described_class } 46 | end 47 | 48 | context 'invalid person' do 49 | subject(:person) { create(:invalid_person) } 50 | 51 | it { is_expected.to be_persisted } 52 | it { is_expected.not_to be_valid } 53 | it { is_expected.to be_an_instance_of described_class } 54 | end 55 | end 56 | 57 | describe '#invalid?' do 58 | context 'valid person' do 59 | subject(:person) { create(:valid_person) } 60 | 61 | it { is_expected.to be_persisted } 62 | it { is_expected.not_to be_invalid } 63 | it { is_expected.to be_an_instance_of described_class } 64 | end 65 | 66 | context 'invalid person' do 67 | subject(:person) { create(:invalid_person) } 68 | 69 | it { is_expected.to be_persisted } 70 | it { is_expected.to be_invalid } 71 | it { is_expected.to be_an_instance_of described_class } 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /spec/unit/block_score/question_set_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::QuestionSet, vcr: true do 2 | describe '.new' do 3 | subject(:question_set) { described_class.new } 4 | 5 | it { is_expected.not_to be_persisted } 6 | it { is_expected.to be_an_instance_of described_class } 7 | end 8 | 9 | describe '.create' do 10 | context 'valid person' do 11 | let(:person_id) { create(:valid_person).id } 12 | subject(:question_set) { described_class.create(person_id: person_id) } 13 | 14 | it { is_expected.to be_persisted } 15 | it { is_expected.to be_an_instance_of described_class } 16 | end 17 | 18 | context 'invalid person' do 19 | let(:person_id) { create(:invalid_person).id } 20 | 21 | it 'is an invalid request' do 22 | expect { described_class.create(person_id: person_id) } 23 | .to raise_error BlockScore::InvalidRequestError 24 | end 25 | end 26 | end 27 | 28 | describe '#score' do 29 | subject(:question_set) { create(:question_set) } 30 | let(:correct_answers) { QuestionSetHelper.correct_answers(question_set.questions) } 31 | let(:incorrect_answers) { QuestionSetHelper.incorrect_answers(question_set.questions) } 32 | 33 | context 'correct answers' do 34 | it { expect(question_set.score(correct_answers)).to be 100.0 } 35 | end 36 | 37 | context 'incorrect answers' do 38 | it { expect(question_set.score(incorrect_answers)).to be 0.0 } 39 | end 40 | 41 | context 'malformed answers' do 42 | it 'raises an error when answers are not an array of hashes' do 43 | expect { question_set.score([]) } 44 | .to raise_error BlockScore::InvalidRequestError, 45 | '(Type: invalid_request_error) ' \ 46 | 'Answers should be an array of objects (Status: 400)' 47 | end 48 | end 49 | 50 | context 'previous answers' do 51 | before { question_set.score(correct_answers) } 52 | 53 | it { expect(question_set.score).to be(100.0) } 54 | end 55 | 56 | context 'previously no answers' do 57 | it { expect(question_set.score).to be nil } 58 | end 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /spec/unit/block_score/util_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe BlockScore::Util, vcr: true do 2 | shared_context 'a transform' do 3 | subject(:actual) { described_class.send(method, input) } 4 | it { should eql(output) } 5 | end 6 | 7 | describe '.to_plural' do 8 | shared_context 'to_plural' do 9 | let(:method) { :to_plural } 10 | include_context 'a transform' 11 | end 12 | 13 | context 'candidate' do 14 | let(:input) { 'candidate' } 15 | let(:output) { 'candidates' } 16 | 17 | it_behaves_like 'to_plural' 18 | end 19 | 20 | context 'question_set' do 21 | let(:input) { 'question_set' } 22 | let(:output) { 'question_sets' } 23 | 24 | it_behaves_like 'to_plural' 25 | end 26 | 27 | context 'company' do 28 | let(:input) { 'company' } 29 | let(:output) { 'companies' } 30 | 31 | it_behaves_like 'to_plural' 32 | end 33 | 34 | context 'person' do 35 | let(:input) { 'person' } 36 | let(:output) { 'people' } 37 | 38 | it_behaves_like 'to_plural' 39 | end 40 | 41 | context 'watchlist_hit' do 42 | let(:input) { 'watchlist_hit' } 43 | let(:output) { 'watchlist_hits' } 44 | 45 | it_behaves_like 'to_plural' 46 | end 47 | end 48 | 49 | describe '.to_camelcase' do 50 | shared_context 'to_camelcase' do 51 | let(:method) { :to_camelcase } 52 | include_context 'a transform' 53 | end 54 | 55 | context 'screaming_snake_case' do 56 | let(:input) { 'screaming_snake_case' } 57 | let(:output) { 'ScreamingSnakeCase' } 58 | 59 | it_behaves_like 'to_camelcase' 60 | end 61 | 62 | context 'snake_case' do 63 | let(:input) { 'snake_case' } 64 | let(:output) { 'SnakeCase' } 65 | 66 | it_behaves_like 'to_camelcase' 67 | end 68 | 69 | context 'foo' do 70 | let(:input) { 'foo' } 71 | let(:output) { 'Foo' } 72 | 73 | it_behaves_like 'to_camelcase' 74 | end 75 | 76 | context 'empty string' do 77 | let(:input) { '' } 78 | let(:output) { '' } 79 | 80 | it_behaves_like 'to_camelcase' 81 | end 82 | end 83 | 84 | describe '.parse_json' do 85 | shared_context 'parse_json' do 86 | let(:method) { :parse_json } 87 | include_context 'a transform' 88 | end 89 | 90 | context 'valid input' do 91 | let(:input) { output.to_json } 92 | let(:output) { { foo: 'bar', baz: 'bat' } } 93 | 94 | it_behaves_like 'parse_json' 95 | end 96 | 97 | context 'translates errors' do 98 | let(:error) do 99 | 'An error has occurred. ' \ 100 | 'If this problem persists, please message support@blockscore.com.' 101 | end 102 | let(:input) { '{{' } 103 | subject(:parse_attempt) { described_class.parse_json(input) } 104 | 105 | it 'raises an error when the json fails to parse' do 106 | expect { subject }.to raise_error do |err| 107 | expect(err).to be_an_instance_of(BlockScore::Error) 108 | expect(err.message).to eql(error) 109 | end 110 | end 111 | end 112 | end 113 | end 114 | -------------------------------------------------------------------------------- /spec/vcr_setup.rb: -------------------------------------------------------------------------------- 1 | require 'vcr' 2 | require 'rspec' 3 | 4 | module BlockScore 5 | RECORD_MODE_KEY = 'VCR_RECORD_MODE'.freeze 6 | ENVIRONMENT_API_KEY = 'BLOCKSCORE_TEST_KEY'.freeze 7 | PLACEHOLDER_API_KEY = 'BLOCKSCORE_TEST_KEY'.freeze 8 | 9 | extend self 10 | 11 | RSpec.configure do |config| 12 | config.before(:context) do 13 | BlockScore.api_key = ENV.fetch(ENVIRONMENT_API_KEY, PLACEHOLDER_API_KEY) 14 | end 15 | 16 | config.around(:each) do |example| 17 | record_option = ENV.fetch(RECORD_MODE_KEY, :none).to_sym 18 | vcr_on = example.metadata.fetch(:vcr, false) 19 | options = { record: (vcr_on ? record_option : :skip) } 20 | BlockScore.run_vcr_example(options, example) 21 | end 22 | end 23 | 24 | VCR.configure do |c| 25 | c.cassette_library_dir = 'spec/cassettes' 26 | c.hook_into :webmock 27 | c.configure_rspec_metadata! 28 | c.ignore_hosts 'codeclimate.com' 29 | 30 | c.filter_sensitive_data(PLACEHOLDER_API_KEY) { ENV[ENVIRONMENT_API_KEY] } 31 | end 32 | 33 | def run_vcr_example(options, example) 34 | if options.fetch(:record).equal?(:skip) 35 | WebMock.allow_net_connect! 36 | VCR.turned_off(&example) 37 | WebMock.disable_net_connect! 38 | else 39 | path = BlockScore.build_path(example.metadata.fetch(:full_description)) 40 | 41 | VCR.use_cassette(path, options, &example) 42 | end 43 | end 44 | 45 | def build_path(full_description) 46 | full_description 47 | .split(/\s+/, 2) 48 | .join('/') 49 | .underscore 50 | .gsub(/[.#?]/, '/') 51 | .gsub(%r(\/+), '/') 52 | .strip 53 | .tr(' ', '_') 54 | .gsub(%r([/_ ]$), '') 55 | end 56 | end 57 | --------------------------------------------------------------------------------