cartodb/spec/lib/url_signer_spec.rb
2020-06-15 10:58:47 +08:00

15 lines
647 B
Ruby

require_relative '../simplecov_helper'
require_relative '../../lib/url_signer'
require_relative '../rspec_configuration.rb'
describe Carto::UrlSigner do
describe '#sign_url' do
it 'behaves like in the example provided' do
url = 'http://maps.google.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID'
private_key = 'vNIXE0xscrmjlyV-12Nj_BvUPaw='
expected_signed_url = 'http://maps.google.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID&signature=KrU1TzVQM7Ur0i8i7K3huiw3MsA='
Carto::UrlSigner.new(private_key).sign_url(url).should == expected_signed_url
end
end
end