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