-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWI-4587 add
transferCallerDisplayName
to Transfer Verb (#127)
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
let(:initial_attributes) { | ||
{ | ||
transfer_caller_id: '+19195551234', | ||
transfer_caller_display_name: 'initial_caller', | ||
call_timeout: 5, | ||
transfer_complete_url: 'https://initial.com', | ||
transfer_complete_method: 'POST', | ||
|
@@ -21,6 +22,7 @@ | |
let(:new_attributes) { | ||
{ | ||
transfer_caller_id: '+19195554321', | ||
transfer_caller_display_name: 'new_caller', | ||
call_timeout: 10, | ||
transfer_complete_url: 'https://new.com', | ||
transfer_complete_method: 'POST', | ||
|
@@ -49,13 +51,13 @@ | |
end | ||
|
||
it 'tests the to_bxml method of the Transfer instance' do | ||
expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\"/>\n" | ||
expected = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\"/>\n" | ||
expect(instance.to_bxml).to eq(expected) | ||
end | ||
|
||
it 'tests the set_attributes method of the Transfer instance' do | ||
instance.set_attributes(new_attributes) | ||
expected = "\n<Transfer transferCallerId=\"+19195554321\" callTimeout=\"10\" transferCompleteUrl=\"https://new.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://new.com\" transferCompleteFallbackMethod=\"POST\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" diversionTreatment=\"stack\" diversionReason=\"no-answer\"/>\n" | ||
expected = "\n<Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"new_caller\" callTimeout=\"10\" transferCompleteUrl=\"https://new.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://new.com\" transferCompleteFallbackMethod=\"POST\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" diversionTreatment=\"stack\" diversionReason=\"no-answer\"/>\n" | ||
expect(instance.to_bxml).to eq(expected) | ||
end | ||
end | ||
|
@@ -67,16 +69,16 @@ | |
end | ||
|
||
it 'tests the to_bxml method of the nested Transfer instance' do | ||
expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n" | ||
expected = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n" | ||
expect(instance_nested.to_bxml).to eq(expected) | ||
end | ||
|
||
it 'tests the add_verb method of the nested Transfer instance' do | ||
expected_single = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:[email protected]</SipUri>\n</Transfer>\n" | ||
expected_single = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:[email protected]</SipUri>\n</Transfer>\n" | ||
instance_nested.add_transfer_recipients(sip_uri) | ||
expect(instance_nested.to_bxml).to eq(expected_single) | ||
|
||
expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:[email protected]</SipUri>\n <SipUri>sip:[email protected]</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n" | ||
expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" transferCallerDisplayName=\"initial_caller\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:[email protected]</SipUri>\n <SipUri>sip:[email protected]</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n" | ||
instance_nested.add_transfer_recipients([sip_uri, phone_number]) | ||
expect(instance_nested.to_bxml).to eq(expected_multiple) | ||
end | ||
|