-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into devx-8424-devx-8419-network-sim-swap-number-…
…verification
- Loading branch information
Showing
6 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,43 @@ def test_ncco_with_valid_action_and_optional_parameters | |
assert_equal action, [{:action=>"connect", :endpoint=>[{:type=>"phone", :number=>"12129999999"}], :from=>'12129992222'}] | ||
end | ||
|
||
def test_ncco_connect_action_sip_endpoint_with_standard_headers | ||
action = ncco.connect( | ||
endpoint: { | ||
type: 'sip', | ||
uri: 'sip:[email protected]', | ||
headers: { | ||
location: 'New York', | ||
occupation: 'developer' | ||
}, | ||
standardHeaders: { | ||
'User-to-User' => '56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=bar' | ||
} | ||
} | ||
) | ||
|
||
action_literal = [ | ||
{ | ||
:action=>"connect", | ||
:endpoint=>[ | ||
{ | ||
:type=>"sip", | ||
:uri=>"sip:[email protected]", | ||
:headers=>{ | ||
location: 'New York', | ||
occupation: 'developer' | ||
}, | ||
:standardHeaders => { | ||
'User-to-User' => '56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=bar' | ||
} | ||
} | ||
] | ||
} | ||
] | ||
|
||
assert_equal action_literal, action | ||
end | ||
|
||
def test_ncco_with_invalid_action | ||
exception = assert_raises { ncco.gotowarp } | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,30 @@ def test_create_method | |
assert_kind_of Vonage::Response, calls.create(params) | ||
end | ||
|
||
def test_create_method_with_connect_to_sip_standard_headers | ||
params = { | ||
to: [ | ||
{ | ||
type: 'sip', | ||
uri: 'sip:[email protected]', | ||
headers: { | ||
location: 'New York', | ||
occupation: 'developer' | ||
}, | ||
standard_headers: { | ||
'User-to-User' => '56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=bar' | ||
} | ||
} | ||
], | ||
from: {type: 'phone', number: '14843335555'}, | ||
answer_url: ['https://example.com/answer'] | ||
} | ||
|
||
stub_request(:post, calls_uri).with(request(body: params)).to_return(response) | ||
|
||
assert_kind_of Vonage::Response, calls.create(params) | ||
end | ||
|
||
def test_create_method_raises_error_if_from_set_and_random_from_number_true | ||
params = { | ||
to: [{type: 'phone', number: '14843331234'}], | ||
|