demarches-normaliennes/spec/lib/universign/api_spec.rb
François Vantomme b9d6c32af7 Test (Universign): mock API URL constant
Addressable::URI::InvalidURIError:
 Absolute URI missing hierarchical segment: 'http://'
2022-02-08 15:59:50 +01:00

13 lines
366 B
Ruby

describe Universign::API do
describe '.request_timestamp', vcr: { cassette_name: 'universign' } do
subject { described_class.timestamp(digest) }
let(:digest) { Digest::SHA256.hexdigest("CECI EST UN HASH") }
before do
stub_const("UNIVERSIGN_API_URL", "https://ws.universign.eu/tsa/post/")
end
it { is_expected.not_to be_nil }
end
end