File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 client = Twilio ::REST ::LookupsClient . new 'otherSid' , 'otherToken'
66 expect ( client ) . to respond_to ( :phone_numbers )
77 end
8+
9+ it 'gets phone numbers without special encoding' do
10+ number = '+13123131434'
11+ client = Twilio ::REST ::LookupsClient . new 'otherSid' , 'otherToken'
12+ expect ( client ) . to receive ( :get ) . once
13+ . with ( '/v1/PhoneNumbers/+13123131434' )
14+ . and_return ( { phone_number : number } )
15+ phone_number = client . phone_numbers . get ( '+13123131434' ) . phone_number
16+ expect ( phone_number ) . to be ( number )
17+ end
18+
19+ it 'URI encodes phone number path parameters' do
20+ number = '+13123131434'
21+ client = Twilio ::REST ::LookupsClient . new 'otherSid' , 'otherToken'
22+ expect ( client ) . to receive ( :get ) . once
23+ . with ( '/v1/PhoneNumbers/+1%20312%20313%201434' )
24+ . and_return ( { phone_number : number } )
25+ phone_number = client . phone_numbers . get ( '+1 312 313 1434' ) . phone_number
26+ expect ( phone_number ) . to be ( number )
27+ end
828end
You can’t perform that action at this time.
0 commit comments