checkr-official 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +12 -0
- data/lib/checkr.rb +2 -0
- data/lib/checkr/report.rb +3 -0
- data/lib/checkr/verification.rb +12 -0
- data/lib/checkr/verification_list.rb +24 -0
- data/lib/checkr/version.rb +1 -1
- data/test/checkr/verification_list_test.rb +25 -0
- data/test/checkr/verifications_test.rb +58 -0
- data/test/test_data.rb +15 -0
- metadata +26 -20
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b07f3ddd1190944c3d314f529b190541e5e316fd
         | 
| 4 | 
            +
              data.tar.gz: dd58c64ca91eda0c017fb3f273d6bd03e86f162d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 799d51c4194e20757f0ca45db79b8901ae80708782dd297261011b4bbb41edc3db47dfaa2e6d55a16e4932e2050f00909b028212cb6283b3f6d93fb6eee06607
         | 
| 7 | 
            +
              data.tar.gz: b4f948a1c26c0619e827b3ea4c3b105d1db2e35efa988e0447966ef2f727166d50f45cb9e47bcd60731acd8925ee2b6a59413016fa50ec11eec19a01e4998a50
         | 
    
        data/Changelog.md
    CHANGED
    
    
    
        data/lib/checkr.rb
    CHANGED
    
    
    
        data/lib/checkr/report.rb
    CHANGED
    
    | @@ -35,6 +35,9 @@ module Checkr | |
| 35 35 | 
             
                attribute :documents, APIList.constructor(:Document)
         | 
| 36 36 | 
             
                attribute_writer_alias :document_ids, :documents
         | 
| 37 37 |  | 
| 38 | 
            +
                attribute :verifications, :VerificationList, :nested => true, :default => {}
         | 
| 39 | 
            +
                attribute_writer_alias :verification_ids, :verifications
         | 
| 40 | 
            +
             | 
| 38 41 | 
             
                api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
         | 
| 39 42 | 
             
                api_class_method :create, :post
         | 
| 40 43 |  | 
| @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            module Checkr
         | 
| 2 | 
            +
              class Verification < APIResource
         | 
| 3 | 
            +
             | 
| 4 | 
            +
                attribute :verification_type
         | 
| 5 | 
            +
                attribute :verification_url
         | 
| 6 | 
            +
                attribute :completed_at
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                api_class_method :all, :get, "/v1/reports/:report_id/verifications", :constructor => :VerificationList
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                APIClass.register_subclass(self, "verification")
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
            end
         | 
| @@ -0,0 +1,24 @@ | |
| 1 | 
            +
            module Checkr
         | 
| 2 | 
            +
              class VerificationList < APIList
         | 
| 3 | 
            +
             | 
| 4 | 
            +
                attribute :next_href
         | 
| 5 | 
            +
                attribute :previous_href
         | 
| 6 | 
            +
                attribute :count
         | 
| 7 | 
            +
                attr_accessor :parent
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                api_instance_method :all, :get
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                def self.construct(json, parent=nil)
         | 
| 12 | 
            +
                  lambda = constructor(:Verification)
         | 
| 13 | 
            +
                  instance = lambda.call(json)
         | 
| 14 | 
            +
                  instance.parent = parent if parent
         | 
| 15 | 
            +
                  instance.clear_changed_attributes
         | 
| 16 | 
            +
                  instance
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                def path
         | 
| 20 | 
            +
                  parent.path + "/verifications"
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
            end
         | 
    
        data/lib/checkr/version.rb
    CHANGED
    
    
| @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            require File.expand_path('../../test_helper', __FILE__)
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Checkr
         | 
| 4 | 
            +
              class VerificationListTest < Test::Unit::TestCase
         | 
| 5 | 
            +
                setup do
         | 
| 6 | 
            +
                  @report = Report.construct(test_report)
         | 
| 7 | 
            +
                  @verification_url = "#{Checkr.api_base}#{@report.path}/verifications"
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                context 'VerificationList class' do
         | 
| 11 | 
            +
                  should 'be listable' do
         | 
| 12 | 
            +
                    @mock.expects(:get).once.with(@verification_url, anything, anything).returns(test_response(test_verification_list))
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    verifications = @report.verifications.all
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                    assert(verifications.is_a?(VerificationList))
         | 
| 17 | 
            +
                    verifications.each do |document|
         | 
| 18 | 
            +
                      assert(document.is_a?(Verification))
         | 
| 19 | 
            +
                    end
         | 
| 20 | 
            +
                    assert(verifications.length > 0)
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
| @@ -0,0 +1,58 @@ | |
| 1 | 
            +
            require File.expand_path('../../test_helper', __FILE__)
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Checkr
         | 
| 4 | 
            +
              class VerificationTest < Test::Unit::TestCase
         | 
| 5 | 
            +
                setup do
         | 
| 6 | 
            +
                  @report = Report.construct(test_report)
         | 
| 7 | 
            +
                  @verification_url = "#{Checkr.api_base}#{@report.path}/verifications"
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                context 'Constructed Verification instance' do
         | 
| 11 | 
            +
                  setup do
         | 
| 12 | 
            +
                    @verification = Verification.construct(test_verification)
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                  should 'have the id attribute' do
         | 
| 16 | 
            +
                    assert_equal(test_verification[:id], @verification.id)
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  should 'have the object attribute' do
         | 
| 20 | 
            +
                    assert_equal(test_verification[:object], @verification.object)
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                  should 'have the uri attribute' do
         | 
| 24 | 
            +
                    assert_equal(test_verification[:uri], @verification.uri)
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                  should 'have the created_at attribute' do
         | 
| 28 | 
            +
                    assert_equal(test_verification[:created_at], @verification.created_at)
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                  should 'have the completed_at attribute' do
         | 
| 32 | 
            +
                    assert_equal(test_verification[:completed_at], @verification.completed_at)
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                  should 'have the verification_type attribute' do
         | 
| 36 | 
            +
                    assert_equal(test_verification[:verification_type], @verification.verification_type)
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  should 'have the verification_url attribute' do
         | 
| 40 | 
            +
                    assert_equal(test_verification[:verification_url], @verification.verification_url)
         | 
| 41 | 
            +
                  end
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                context '#all' do
         | 
| 45 | 
            +
                  should 'return instances of Verification' do
         | 
| 46 | 
            +
                    @mock.expects(:get).once.with(@verification_url, anything, anything)
         | 
| 47 | 
            +
                        .returns(test_response(test_verification_list))
         | 
| 48 | 
            +
                    assert_equal(@report.verifications.all.first.class, Verification)
         | 
| 49 | 
            +
                  end
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                should 'be registered' do
         | 
| 53 | 
            +
                  assert(APIClass.subclasses.include?(Verification))
         | 
| 54 | 
            +
                  assert_equal(Verification, APIClass.subclass_fetch('verification'))
         | 
| 55 | 
            +
                end
         | 
| 56 | 
            +
             | 
| 57 | 
            +
              end
         | 
| 58 | 
            +
            end
         | 
    
        data/test/test_data.rb
    CHANGED
    
    | @@ -457,6 +457,21 @@ module Checkr | |
| 457 457 | 
             
                  }
         | 
| 458 458 | 
             
                end
         | 
| 459 459 |  | 
| 460 | 
            +
                def test_verification
         | 
| 461 | 
            +
                  {:id=>"db313e73383710d4fa2f18fd",
         | 
| 462 | 
            +
                   :object=>"verification",
         | 
| 463 | 
            +
                   :created_at=>"2015-02-11T20:01:50Z",
         | 
| 464 | 
            +
                   :verification_type=>"id",
         | 
| 465 | 
            +
                   :verification_url=>"http://verifications.checkr.com/db313e73383710d4fa2f18fd",
         | 
| 466 | 
            +
                   :completed_at=>nil}
         | 
| 467 | 
            +
                end
         | 
| 468 | 
            +
                def test_verification_list
         | 
| 469 | 
            +
                  {
         | 
| 470 | 
            +
                    :object => 'list',
         | 
| 471 | 
            +
                    :data => [test_verification, test_verification, test_verification],
         | 
| 472 | 
            +
                  }
         | 
| 473 | 
            +
                end
         | 
| 474 | 
            +
             | 
| 460 475 | 
             
                # Errors
         | 
| 461 476 | 
             
                def test_api_error
         | 
| 462 477 | 
             
                  {
         | 
    
        metadata
    CHANGED
    
    | @@ -1,83 +1,83 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: checkr-official
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jon Calhoun
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-01- | 
| 11 | 
            +
            date: 2018-01-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rest-client
         | 
| 15 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 16 | 
             
                requirements:
         | 
| 17 | 
            -
                - -  | 
| 17 | 
            +
                - - '>='
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 19 | 
             
                    version: '1.4'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - -  | 
| 24 | 
            +
                - - '>='
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: '1.4'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: json
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 30 | 
             
                requirements:
         | 
| 31 | 
            -
                - -  | 
| 31 | 
            +
                - - '>='
         | 
| 32 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 33 | 
             
                    version: 1.8.1
         | 
| 34 34 | 
             
              type: :runtime
         | 
| 35 35 | 
             
              prerelease: false
         | 
| 36 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 37 | 
             
                requirements:
         | 
| 38 | 
            -
                - -  | 
| 38 | 
            +
                - - '>='
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 40 | 
             
                    version: 1.8.1
         | 
| 41 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 42 | 
             
              name: mocha
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 44 | 
             
                requirements:
         | 
| 45 | 
            -
                - -  | 
| 45 | 
            +
                - - ~>
         | 
| 46 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 47 | 
             
                    version: 0.13.2
         | 
| 48 48 | 
             
              type: :development
         | 
| 49 49 | 
             
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 | 
            -
                - -  | 
| 52 | 
            +
                - - ~>
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: 0.13.2
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 56 | 
             
              name: shoulda
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 58 | 
             
                requirements:
         | 
| 59 | 
            -
                - -  | 
| 59 | 
            +
                - - ~>
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 61 | 
             
                    version: 3.4.0
         | 
| 62 62 | 
             
              type: :development
         | 
| 63 63 | 
             
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 | 
            -
                - -  | 
| 66 | 
            +
                - - ~>
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: 3.4.0
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: activesupport
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 | 
            -
                - -  | 
| 73 | 
            +
                - - ~>
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 75 | 
             
                    version: 4.2.6
         | 
| 76 76 | 
             
              type: :development
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 | 
            -
                - -  | 
| 80 | 
            +
                - - ~>
         | 
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 82 | 
             
                    version: 4.2.6
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -112,14 +112,14 @@ dependencies: | |
| 112 112 | 
             
              name: test-unit
         | 
| 113 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 114 114 | 
             
                requirements:
         | 
| 115 | 
            -
                - -  | 
| 115 | 
            +
                - - '>='
         | 
| 116 116 | 
             
                  - !ruby/object:Gem::Version
         | 
| 117 117 | 
             
                    version: '0'
         | 
| 118 118 | 
             
              type: :development
         | 
| 119 119 | 
             
              prerelease: false
         | 
| 120 120 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 121 121 | 
             
                requirements:
         | 
| 122 | 
            -
                - -  | 
| 122 | 
            +
                - - '>='
         | 
| 123 123 | 
             
                  - !ruby/object:Gem::Version
         | 
| 124 124 | 
             
                    version: '0'
         | 
| 125 125 | 
             
            description: Checkr - Automated background screenings and driving records. See https://checkr.com/
         | 
| @@ -131,9 +131,9 @@ executables: | |
| 131 131 | 
             
            extensions: []
         | 
| 132 132 | 
             
            extra_rdoc_files: []
         | 
| 133 133 | 
             
            files:
         | 
| 134 | 
            -
            -  | 
| 135 | 
            -
            -  | 
| 136 | 
            -
            -  | 
| 134 | 
            +
            - .gitignore
         | 
| 135 | 
            +
            - .rubocop.yml
         | 
| 136 | 
            +
            - .travis.yml
         | 
| 137 137 | 
             
            - Changelog.md
         | 
| 138 138 | 
             
            - Gemfile
         | 
| 139 139 | 
             
            - README.md
         | 
| @@ -169,6 +169,8 @@ files: | |
| 169 169 | 
             
            - lib/checkr/ssn_trace.rb
         | 
| 170 170 | 
             
            - lib/checkr/subscription.rb
         | 
| 171 171 | 
             
            - lib/checkr/util.rb
         | 
| 172 | 
            +
            - lib/checkr/verification.rb
         | 
| 173 | 
            +
            - lib/checkr/verification_list.rb
         | 
| 172 174 | 
             
            - lib/checkr/version.rb
         | 
| 173 175 | 
             
            - mclovin.jpg
         | 
| 174 176 | 
             
            - samples/candidate.md
         | 
| @@ -207,6 +209,8 @@ files: | |
| 207 209 | 
             
            - test/checkr/status_codes_test.rb
         | 
| 208 210 | 
             
            - test/checkr/subscription_test.rb
         | 
| 209 211 | 
             
            - test/checkr/util_test.rb
         | 
| 212 | 
            +
            - test/checkr/verification_list_test.rb
         | 
| 213 | 
            +
            - test/checkr/verifications_test.rb
         | 
| 210 214 | 
             
            - test/mock_resource.rb
         | 
| 211 215 | 
             
            - test/test_data.rb
         | 
| 212 216 | 
             
            - test/test_helper.rb
         | 
| @@ -219,17 +223,17 @@ require_paths: | |
| 219 223 | 
             
            - lib
         | 
| 220 224 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 221 225 | 
             
              requirements:
         | 
| 222 | 
            -
              - -  | 
| 226 | 
            +
              - - '>='
         | 
| 223 227 | 
             
                - !ruby/object:Gem::Version
         | 
| 224 228 | 
             
                  version: 1.9.3
         | 
| 225 229 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 226 230 | 
             
              requirements:
         | 
| 227 | 
            -
              - -  | 
| 231 | 
            +
              - - '>='
         | 
| 228 232 | 
             
                - !ruby/object:Gem::Version
         | 
| 229 233 | 
             
                  version: '0'
         | 
| 230 234 | 
             
            requirements: []
         | 
| 231 235 | 
             
            rubyforge_project: 
         | 
| 232 | 
            -
            rubygems_version: 2. | 
| 236 | 
            +
            rubygems_version: 2.0.14.1
         | 
| 233 237 | 
             
            signing_key: 
         | 
| 234 238 | 
             
            specification_version: 4
         | 
| 235 239 | 
             
            summary: Ruby bindings for Checkr API
         | 
| @@ -257,6 +261,8 @@ test_files: | |
| 257 261 | 
             
            - test/checkr/status_codes_test.rb
         | 
| 258 262 | 
             
            - test/checkr/subscription_test.rb
         | 
| 259 263 | 
             
            - test/checkr/util_test.rb
         | 
| 264 | 
            +
            - test/checkr/verification_list_test.rb
         | 
| 265 | 
            +
            - test/checkr/verifications_test.rb
         | 
| 260 266 | 
             
            - test/mock_resource.rb
         | 
| 261 267 | 
             
            - test/test_data.rb
         | 
| 262 268 | 
             
            - test/test_helper.rb
         |