blueline_services 0.1.5
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.
- data/.gitignore +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +46 -0
- data/README.md +66 -0
- data/Rakefile +26 -0
- data/blueline_services.gemspec +31 -0
- data/lib/blueline_services.rb +19 -0
- data/lib/blueline_services/configuration.rb +54 -0
- data/lib/blueline_services/dsl.rb +30 -0
- data/lib/blueline_services/person_name.rb +29 -0
- data/lib/blueline_services/request.rb +155 -0
- data/lib/blueline_services/response.rb +43 -0
- data/lib/blueline_services/screening/civil_county.rb +17 -0
- data/lib/blueline_services/screening/credit.rb +16 -0
- data/lib/blueline_services/screening/criminal_county.rb +17 -0
- data/lib/blueline_services/screening/criminal_federal.rb +17 -0
- data/lib/blueline_services/screening/criminal_security.rb +12 -0
- data/lib/blueline_services/screening/criminal_state.rb +16 -0
- data/lib/blueline_services/screening/eviction.rb +16 -0
- data/lib/blueline_services/screening/model.rb +27 -0
- data/lib/blueline_services/screening/person_search.rb +16 -0
- data/lib/blueline_services/version.rb +3 -0
- data/test/integration/initial_request_test.rb +21 -0
- data/test/test-updated.xml +111 -0
- data/test/test_helper.rb +115 -0
- data/test/unit/request_test.rb +93 -0
- data/test/unit/response_test.rb +65 -0
- data/test/unit/screening/civil_county_test.rb +12 -0
- data/test/unit/screening/credit_test.rb +12 -0
- data/test/unit/screening/criminal_county_test.rb +12 -0
- data/test/unit/screening/criminal_federal_test.rb +12 -0
- data/test/unit/screening/criminal_security_test.rb +11 -0
- data/test/unit/screening/criminal_state_test.rb +12 -0
- data/test/unit/screening/eviction_test.rb +11 -0
- data/test/unit/screening/model_test.rb +37 -0
- data/test/unit/screening/person_search_test.rb +11 -0
- metadata +229 -0
| @@ -0,0 +1,43 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              class Response
         | 
| 3 | 
            +
             | 
| 4 | 
            +
                attr_reader :user_id, :password, :reference_id, :order_id, :order_status
         | 
| 5 | 
            +
                attr_reader :result_status
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                # ErrorReport
         | 
| 8 | 
            +
                attr_reader :error_code, :error_description
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                # postback
         | 
| 11 | 
            +
                attr_reader :result_status,
         | 
| 12 | 
            +
                            :order_status_flag,
         | 
| 13 | 
            +
                            :screening_results_type,
         | 
| 14 | 
            +
                            :screening_results_media_type,
         | 
| 15 | 
            +
                            :screening_results_result_type,
         | 
| 16 | 
            +
                            :result_url
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                attr_reader :data
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                def initialize(data)
         | 
| 21 | 
            +
                  @data = data
         | 
| 22 | 
            +
                  document = Nokogiri::XML.parse(data)
         | 
| 23 | 
            +
                  @user_id = document.at("//@userId").try(:value)
         | 
| 24 | 
            +
                  @password = document.at("//@password").try(:value)
         | 
| 25 | 
            +
                  @reference_id = document.at("//ReferenceId").try(:text)
         | 
| 26 | 
            +
                  @order_id = document.at("//OrderId").try(:text)
         | 
| 27 | 
            +
                  @order_status = document.at("//OrderStatus").try(:text)
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  # errors
         | 
| 30 | 
            +
                  @error_code = document.at("//ErrorCode").try(:text)
         | 
| 31 | 
            +
                  @error_description = document.at("//ErrorDescription").try(:text)
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  # completed postback response
         | 
| 34 | 
            +
                  @result_status = document.at("//ResultStatus").try(:text)
         | 
| 35 | 
            +
                  @order_status_flag = document.at("//OrderStatus//@flag").try(:value)
         | 
| 36 | 
            +
                  @screening_results_type = document.at("//ScreeningResults//@type").try(:value)
         | 
| 37 | 
            +
                  @screening_results_media_type = document.at("//ScreeningResults//@mediaType").try(:value)
         | 
| 38 | 
            +
                  @screening_results_result_type = document.at("//ScreeningResults//@resultType").try(:value)
         | 
| 39 | 
            +
                  @result_url = document.at("//InternetWebAddress").try(:text)
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class CivilCounty
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :region, :county
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "civil", :qualifier => "county") do |xml|
         | 
| 10 | 
            +
                      xml.Region region unless region.nil?
         | 
| 11 | 
            +
                      xml.County county unless county.nil?
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class Credit
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :score, :fraud, :vendor
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "credit") do |xml|
         | 
| 10 | 
            +
                      xml.Vendor(vendor, :score => score, :fraud => fraud)
         | 
| 11 | 
            +
                    end
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class CriminalCounty
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :region, :county
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "criminal", :qualifier => "county") do |xml|
         | 
| 10 | 
            +
                      xml.Region region unless region.nil?
         | 
| 11 | 
            +
                      xml.County county unless county.nil?
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class CriminalFederal
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :region, :district
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "criminal", :qualifier => "federal") do |xml|
         | 
| 10 | 
            +
                      xml.Region region unless region.nil?
         | 
| 11 | 
            +
                      xml.District district unless district.nil?
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class CriminalState
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :region
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "criminal", :qualifier => "statewide") do |xml|
         | 
| 10 | 
            +
                      xml.Region region unless region.nil?
         | 
| 11 | 
            +
                    end
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class Eviction
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :region
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "eviction", :qualifier => "statewide") do |xml|
         | 
| 10 | 
            +
                      xml.Region region unless region.nil?
         | 
| 11 | 
            +
                    end
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                module Model
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                  def initialize(h={})
         | 
| 6 | 
            +
                    h.each {|k,v| send("#{k}=", v) if respond_to?("#{k}=") }
         | 
| 7 | 
            +
                  end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  def builder(attributes={})
         | 
| 10 | 
            +
                    Nokogiri::XML::Builder.new do |xml|
         | 
| 11 | 
            +
                      xml.send("Screening", attributes) {
         | 
| 12 | 
            +
                        yield xml if block_given?
         | 
| 13 | 
            +
                      }
         | 
| 14 | 
            +
                    end.parent.root
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                  def as_xml
         | 
| 18 | 
            +
                    raise NotImplementedError
         | 
| 19 | 
            +
                  end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  def to_xml
         | 
| 22 | 
            +
                    as_xml.to_xml
         | 
| 23 | 
            +
                  end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module BluelineServices
         | 
| 2 | 
            +
              module Screening
         | 
| 3 | 
            +
                class PersonSearch
         | 
| 4 | 
            +
                  include Screening::Model
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  attr_accessor :vendor
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def as_xml
         | 
| 9 | 
            +
                    builder(:type => "personsearch") do |xml|
         | 
| 10 | 
            +
                      xml.Vendor vendor unless vendor.nil?
         | 
| 11 | 
            +
                    end
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            require 'test_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module BluelineServices
         | 
| 4 | 
            +
              class InitialRequestTest < Test::Unit::TestCase
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                context "#submit" do
         | 
| 7 | 
            +
                  context "with no credentials" do
         | 
| 8 | 
            +
                    subject { Request.new }
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                    should "get an error response" do
         | 
| 11 | 
            +
                      response = subject.submit
         | 
| 12 | 
            +
                      assert_equal "x:error", response.order_status
         | 
| 13 | 
            +
                      assert_equal "120", response.error_code
         | 
| 14 | 
            +
                      assert_equal "Invalid login transaction. Bad credentials.",
         | 
| 15 | 
            +
                                   response.error_description
         | 
| 16 | 
            +
                    end
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
            end
         | 
| @@ -0,0 +1,111 @@ | |
| 1 | 
            +
            <?xml version="1.0"?>
         | 
| 2 | 
            +
            <BackgroundCheck password="" userId="">
         | 
| 3 | 
            +
              <BackgroundSearchPackage action="submit" type="TST Media">
         | 
| 4 | 
            +
                <ReferenceId>112233</ReferenceId>
         | 
| 5 | 
            +
                <PersonalData>
         | 
| 6 | 
            +
                  <EmailAddresss></EmailAddresss>
         | 
| 7 | 
            +
                  <Telephone></Telephone>
         | 
| 8 | 
            +
                  <PersonName>
         | 
| 9 | 
            +
                    <GivenName>HANK</GivenName>
         | 
| 10 | 
            +
                    <MiddleName></MiddleName>
         | 
| 11 | 
            +
                    <FamilyName>MESS</FamilyName>
         | 
| 12 | 
            +
                  </PersonName>
         | 
| 13 | 
            +
                  <DemographicDetail>
         | 
| 14 | 
            +
                    <GovernmentId countryCode="US" issuingAuthority="SSN">333-22-1111</GovernmentId>
         | 
| 15 | 
            +
                  </DemographicDetail>
         | 
| 16 | 
            +
                  <PostalAddress>
         | 
| 17 | 
            +
                    <PostalCode>60750</PostalCode>
         | 
| 18 | 
            +
                    <Region>IL</Region>
         | 
| 19 | 
            +
                    <Municipality>FANTASY ISLAND</Municipality>
         | 
| 20 | 
            +
                    <DeliveryAddress>
         | 
| 21 | 
            +
                      <AddressLine>899</AddressLine>
         | 
| 22 | 
            +
                      <StreetName>LINCOLN RD</StreetName>
         | 
| 23 | 
            +
                    </DeliveryAddress>
         | 
| 24 | 
            +
                  </PostalAddress>
         | 
| 25 | 
            +
                </PersonalData>
         | 
| 26 | 
            +
                <Screenings useConfigurationDefaults="no">
         | 
| 27 | 
            +
                  <!-- Person Search / SSN verification -->
         | 
| 28 | 
            +
                  <Screening type="personsearch">
         | 
| 29 | 
            +
                  </Screening>
         | 
| 30 | 
            +
                  <!-- County Criminal -->
         | 
| 31 | 
            +
                  <Screening type="criminal" qualifier="county">
         | 
| 32 | 
            +
                  </Screening>
         | 
| 33 | 
            +
                  <!-- Federal Criminal -->
         | 
| 34 | 
            +
                  <Screening type="criminal" qualifier="federal">
         | 
| 35 | 
            +
                  </Screening>
         | 
| 36 | 
            +
                  <!-- Instant Nationwide DB check -->
         | 
| 37 | 
            +
                  <Screening type="criminal" qualifier="national">
         | 
| 38 | 
            +
                  </Screening>
         | 
| 39 | 
            +
                  <!-- Manual Statewide Criminal -->
         | 
| 40 | 
            +
                  <Screening type="criminal" qualifier="statewide">
         | 
| 41 | 
            +
                  </Screening>
         | 
| 42 | 
            +
                  <!-- Employment Verification -->
         | 
| 43 | 
            +
                  <Screening type="employment" verify="yes">
         | 
| 44 | 
            +
                    <OrganizationName>Burger Shack</OrganizationName>
         | 
| 45 | 
            +
                    <Title>Fry Cook</Title>
         | 
| 46 | 
            +
                    <StartDate>2005-05-05</StartDate>
         | 
| 47 | 
            +
                    <EndDate>2005-06-16</EndDate>
         | 
| 48 | 
            +
                    <Compensation>6.50/hr</Compensation>
         | 
| 49 | 
            +
                    <ContactInfo>
         | 
| 50 | 
            +
                      <PersonName>
         | 
| 51 | 
            +
                        <FormattedName>Susan Boss</FormattedName>
         | 
| 52 | 
            +
                      </PersonName>
         | 
| 53 | 
            +
                      <Telephone>801-123-4567</Telephone>
         | 
| 54 | 
            +
                      <Fax>801-999-9999</Fax>
         | 
| 55 | 
            +
                      <EmailAddress>susan@example.com</EmailAddress>
         | 
| 56 | 
            +
                      <PostalAddress>
         | 
| 57 | 
            +
                        <PostalCode>84020</PostalCode>
         | 
| 58 | 
            +
                        <Region>UT</Region>
         | 
| 59 | 
            +
                        <Municipality>Draper</Municipality>
         | 
| 60 | 
            +
                        <DeliveryAddress>
         | 
| 61 | 
            +
                          <AddressLine>1192</AddressLine>
         | 
| 62 | 
            +
                          <StreetName>Draper Parkway #401</StreetName>
         | 
| 63 | 
            +
                        </DeliveryAddress>
         | 
| 64 | 
            +
                      </PostalAddress>
         | 
| 65 | 
            +
                    </ContactInfo>
         | 
| 66 | 
            +
                  </Screening>
         | 
| 67 | 
            +
                  <!-- Education Verification -->
         | 
| 68 | 
            +
                  <Screening type="education">
         | 
| 69 | 
            +
                    <Region>UT</Region>
         | 
| 70 | 
            +
                    <EducationHistory>
         | 
| 71 | 
            +
                      <SchoolOrInstitution schoolType="university">
         | 
| 72 | 
            +
                        <SchoolName>UNIVERSITY OF UTAH</SchoolName>
         | 
| 73 | 
            +
                        <LocationSummary>
         | 
| 74 | 
            +
                          <Municipality>SALT LAKE CITY</Municipality>
         | 
| 75 | 
            +
                          <Region>UT</Region>
         | 
| 76 | 
            +
                        </LocationSummary>
         | 
| 77 | 
            +
                        <Degree degreeType="bachelors">
         | 
| 78 | 
            +
                          <DegreeName>COMMUNICATIONS</DegreeName>
         | 
| 79 | 
            +
                        </Degree>
         | 
| 80 | 
            +
                        <DatesOfAttendance>
         | 
| 81 | 
            +
                          <StartDate>
         | 
| 82 | 
            +
                            <StringDate>2002-09 TO 2006-01</StringDate>
         | 
| 83 | 
            +
                          </StartDate>
         | 
| 84 | 
            +
                        </DatesOfAttendance>
         | 
| 85 | 
            +
                      </SchoolOrInstitution>
         | 
| 86 | 
            +
                    </EducationHistory>
         | 
| 87 | 
            +
                  </Screening>
         | 
| 88 | 
            +
                  <!-- Instant Driving Records -->
         | 
| 89 | 
            +
                  <Screening type="license" qualifier="imvPersonal">
         | 
| 90 | 
            +
                    <Region>UT</Region>
         | 
| 91 | 
            +
                    <SearchLicense>
         | 
| 92 | 
            +
                      <License>
         | 
| 93 | 
            +
                        <LicenseNumber>123456789</LicenseNumber>
         | 
| 94 | 
            +
                        <LicensingAgency>UT</LicensingAgency>
         | 
| 95 | 
            +
                        <LicenseName>mvPersonal</LicenseName>
         | 
| 96 | 
            +
                      </License>
         | 
| 97 | 
            +
                    </SearchLicense>
         | 
| 98 | 
            +
                  </Screening>
         | 
| 99 | 
            +
             | 
| 100 | 
            +
                  <AdditionalItems type="x:postback_username">
         | 
| 101 | 
            +
                    <Text>user</Text>
         | 
| 102 | 
            +
                  </AdditionalItems>
         | 
| 103 | 
            +
                  <AdditionalItems type="x:postback_password">
         | 
| 104 | 
            +
                    <Text>secret</Text>
         | 
| 105 | 
            +
                  </AdditionalItems>
         | 
| 106 | 
            +
                  <AdditionalItems type="x:postback_url">
         | 
| 107 | 
            +
                    <Text>http://127.0.0.1/listen.php</Text>
         | 
| 108 | 
            +
                  </AdditionalItems>
         | 
| 109 | 
            +
                </Screenings>
         | 
| 110 | 
            +
              </BackgroundSearchPackage>
         | 
| 111 | 
            +
            </BackgroundCheck>
         | 
    
        data/test/test_helper.rb
    ADDED
    
    | @@ -0,0 +1,115 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'test/unit'
         | 
| 3 | 
            +
            require 'shoulda'
         | 
| 4 | 
            +
            require 'mocha'
         | 
| 5 | 
            +
            require 'blueline_services'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            class Test::Unit::TestCase
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              def self.should_have_attr_accessor(*args)
         | 
| 10 | 
            +
                should "have attr_accessor for #{args.inspect}" do
         | 
| 11 | 
            +
                  args.each do |a|
         | 
| 12 | 
            +
                    assert_respond_to subject, a
         | 
| 13 | 
            +
                    assert_respond_to subject, "#{a}="
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              def self.should_have_attr_reader(*args)
         | 
| 19 | 
            +
                should "have attr_reader for #{args.inspect}" do
         | 
| 20 | 
            +
                  args.each do |a|
         | 
| 21 | 
            +
                    assert_respond_to subject, a
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              def self.should_call_builder_with(*args)
         | 
| 27 | 
            +
                should "should set type and qualifier attributes" do
         | 
| 28 | 
            +
                  node = mock
         | 
| 29 | 
            +
                  subject.expects(:builder).
         | 
| 30 | 
            +
                          with(*args).
         | 
| 31 | 
            +
                          returns(node)
         | 
| 32 | 
            +
                  assert_equal node, subject.as_xml
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              def assert_xml_attr_equal(node, method_name, attribute_name=method_name)
         | 
| 37 | 
            +
                assert_equal subject.send(method_name).to_s,
         | 
| 38 | 
            +
                             node.at("//@#{attribute_name}").value
         | 
| 39 | 
            +
              end
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              def assert_xml_text_equal(node, method_name, attribute_name=method_name.to_s.camelize)
         | 
| 42 | 
            +
                expected = subject.send(method_name).to_s
         | 
| 43 | 
            +
                actual = node.at("//#{attribute_name}").try(:text).to_s
         | 
| 44 | 
            +
                #puts "for #{method_name}, assert_equal #{expected}, #{actual}"
         | 
| 45 | 
            +
                assert_equal expected, actual
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              TEST_HASH = {
         | 
| 49 | 
            +
                :user_name => "username",
         | 
| 50 | 
            +
                :password => "password",
         | 
| 51 | 
            +
                :type => "My Package",
         | 
| 52 | 
            +
                :reference_id => 112233,
         | 
| 53 | 
            +
                :given_name => "HANK",
         | 
| 54 | 
            +
                :family_name => "MESS",
         | 
| 55 | 
            +
                :ssn => "333-22-1111",
         | 
| 56 | 
            +
                :date_of_birth => "1960-01-01",
         | 
| 57 | 
            +
                :postal_code => "60750",
         | 
| 58 | 
            +
                :region => "IL",
         | 
| 59 | 
            +
                :municipality => "FANTASY ISLAND",
         | 
| 60 | 
            +
                :address_line => 899,
         | 
| 61 | 
            +
                :street_name => "LINCOLN RD",
         | 
| 62 | 
            +
                :postback_url => "http://127.0.0.1/listen.php",
         | 
| 63 | 
            +
                :postback_username => "user",
         | 
| 64 | 
            +
                :postback_password => "secret",
         | 
| 65 | 
            +
                :use_defaults => true
         | 
| 66 | 
            +
              }
         | 
| 67 | 
            +
             | 
| 68 | 
            +
              TEST_ERROR_RESPONSE = %Q{
         | 
| 69 | 
            +
                <BackgroundReports>
         | 
| 70 | 
            +
                  <BackgroundReportPackage>
         | 
| 71 | 
            +
                    <ReferenceId>some_id_value</ReferenceId>
         | 
| 72 | 
            +
                    <ScreeningStatus>
         | 
| 73 | 
            +
                      <OrderStatus>x:error</OrderStatus>
         | 
| 74 | 
            +
                    </ScreeningStatus>
         | 
| 75 | 
            +
                    <ErrorReport>
         | 
| 76 | 
            +
                      <ErrorCode>4</ErrorCode>
         | 
| 77 | 
            +
                      <ErrorDescription>Invalid username and/or password.</ErrorDescription>
         | 
| 78 | 
            +
                    </ErrorReport>
         | 
| 79 | 
            +
                  </BackgroundReportPackage>
         | 
| 80 | 
            +
                </BackgroundReports>
         | 
| 81 | 
            +
              }
         | 
| 82 | 
            +
             | 
| 83 | 
            +
              TEST_PENDING_RESPONSE = %Q{
         | 
| 84 | 
            +
                <BackgroundReports>
         | 
| 85 | 
            +
                  <BackgroundReportPackage>
         | 
| 86 | 
            +
                    <ReferenceId>some_id_value</ReferenceId>
         | 
| 87 | 
            +
                    <OrderId>12358</OrderId>
         | 
| 88 | 
            +
                    <ScreeningStatus>
         | 
| 89 | 
            +
                      <OrderStatus>x:pending</OrderStatus>
         | 
| 90 | 
            +
                    </ScreeningStatus>
         | 
| 91 | 
            +
                  </BackgroundReportPackage>
         | 
| 92 | 
            +
                </BackgroundReports>
         | 
| 93 | 
            +
              }
         | 
| 94 | 
            +
             | 
| 95 | 
            +
              TEST_CALLBACK_RESPONSE = %Q{
         | 
| 96 | 
            +
                <BackgroundReports userId="username" password="password">
         | 
| 97 | 
            +
                  <BackgroundReportPackage>
         | 
| 98 | 
            +
                    <ReferenceId>some_id_value</ReferenceId>
         | 
| 99 | 
            +
                    <OrderId>12358</OrderId>
         | 
| 100 | 
            +
                    <ScreeningStatus>
         | 
| 101 | 
            +
                      <OrderStatus flag="FALSE">x:ready</OrderStatus>
         | 
| 102 | 
            +
                      <ResultStatus>Pass</ResultStatus>
         | 
| 103 | 
            +
                    </ScreeningStatus>
         | 
| 104 | 
            +
                    <Screenings>
         | 
| 105 | 
            +
                      <Screening>
         | 
| 106 | 
            +
                        <ScreeningResults type="result" mediaType="html" resultType="report">
         | 
| 107 | 
            +
                          <InternetWebAddress>display.php</InternetWebAddress>
         | 
| 108 | 
            +
                        </ScreeningResults>
         | 
| 109 | 
            +
                      </Screening>
         | 
| 110 | 
            +
                    </Screenings>
         | 
| 111 | 
            +
                  </BackgroundReportPackage>
         | 
| 112 | 
            +
                </BackgroundReports>
         | 
| 113 | 
            +
              }
         | 
| 114 | 
            +
             | 
| 115 | 
            +
            end
         |