Sha256: 3133053f3597a65d77e82d38a2b5d42464db0be3f568fba3f5ad956d387d206d

Contents?: true

Size: 989 Bytes

Versions: 6

Compression:

Stored size: 989 Bytes

Contents

require 'spec_helper'

RSpec.describe PortalConnectors::LivenessDetectionClient do
  let(:client) { PortalConnectors::LivenessDetectionClient.singleton }

  describe "#fetch_verification_by_id", :vcr do
    context "verification is existing" do
      it "returns verification" do
        client = described_class.singleton
        data, ok = client.fetch_verification_by_id("84c01d36-3eae-11ec-ab16-2a3629a5f0e9")
        expect(ok).to eq true
        expect(data["frames"].length).to eq 6
        expect(data["frames_bucket"]).to eq "staging4-liveness-service-framesbucket-tgrpqwhuov6o"
        expect(data["frames_region"]).to eq "us-east-1"
      end
    end

    context "verification does not exist" do
      it "returns error" do
        client = described_class.singleton
        data, ok = client.fetch_verification_by_id("84c01d36-3eae-11ec-ab16-2a3629a5f0e0")
        expect(ok).to eq false
        expect(data["message"]).to eq "Challenge not found"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
portal-connectors-0.58.39xc spec/lib/portal-connectors/liveness_detection_client_spec.rb
portal-connectors-0.58.39xb spec/lib/portal-connectors/liveness_detection_client_spec.rb
portal-connectors-0.58.39xa spec/lib/portal-connectors/liveness_detection_client_spec.rb
portal-connectors-0.58.39fj spec/lib/portal-connectors/liveness_detection_client_spec.rb
portal-connectors-0.58.39fg spec/lib/portal-connectors/liveness_detection_client_spec.rb
portal-connectors-0.58.38xn spec/lib/portal-connectors/liveness_detection_client_spec.rb