|
6 | 6 | mode: 'unidirectional', |
7 | 7 | tracks: 'inbound', |
8 | 8 | destination: 'https://initial.com', |
| 9 | + destination_username: 'initial_destination_username', |
| 10 | + destination_password: 'initial_destination_password', |
9 | 11 | stream_event_url: 'https://initial.com', |
10 | 12 | stream_event_method: 'POST', |
11 | 13 | username: 'initial_username', |
|
19 | 21 | mode: 'bidirectional', |
20 | 22 | tracks: 'outbound', |
21 | 23 | destination: 'https://new.com', |
| 24 | + destination_username: 'new_destination_username', |
| 25 | + destination_password: 'new_destination_password', |
22 | 26 | stream_event_url: 'https://new.com', |
23 | 27 | stream_event_method: 'GET', |
24 | 28 | username: 'new_username', |
|
39 | 43 | end |
40 | 44 |
|
41 | 45 | it 'tests the to_bxml method of the StartStream instance' do |
42 | | - expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\"/>\n" |
| 46 | + expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destination_username=\"initial_destination_username\" destination_password=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\"/>\n" |
43 | 47 | expect(instance.to_bxml).to eq(expected) |
44 | 48 | end |
45 | 49 |
|
46 | 50 | it 'tests the set_attributes method of the StartStream instance' do |
47 | 51 | instance.set_attributes(new_attributes) |
48 | | - expected = "\n<StartStream name=\"new_name\" mode=\"bidirectional\" tracks=\"outbound\" destination=\"https://new.com\" streamEventUrl=\"https://new.com\" streamEventMethod=\"GET\" username=\"new_username\" password=\"new_password\"/>\n" |
| 52 | + expected = "\n<StartStream name=\"new_name\" mode=\"bidirectional\" tracks=\"outbound\" destination=\"https://new.com\" destination_username=\"new_destination_username\" destination_password=\"new_destination_password\" streamEventUrl=\"https://new.com\" streamEventMethod=\"GET\" username=\"new_username\" password=\"new_password\"/>\n" |
49 | 53 | expect(instance.to_bxml).to eq(expected) |
50 | 54 | end |
51 | 55 | end |
|
57 | 61 | end |
58 | 62 |
|
59 | 63 | it 'tests the to_bxml method of the nested StartStream instance' do |
60 | | - expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n</StartStream>\n" |
| 64 | + expected = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destination_username=\"initial_destination_username\" destination_password=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n</StartStream>\n" |
61 | 65 | expect(instance_nested.to_bxml).to eq(expected) |
62 | 66 | end |
63 | 67 |
|
64 | 68 | it 'tests the add_stream_param method of the nested StartStream instance' do |
65 | | - expected_single = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n" |
| 69 | + expected_single = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destination_username=\"initial_destination_username\" destination_password=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n" |
66 | 70 | instance_nested.add_stream_params(stream_param_2) |
67 | 71 | expect(instance_nested.to_bxml).to eq(expected_single) |
68 | 72 |
|
69 | | - expected_multiple = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n" |
| 73 | + expected_multiple = "\n<StartStream name=\"initial_name\" mode=\"unidirectional\" tracks=\"inbound\" destination=\"https://initial.com\" destination_username=\"initial_destination_username\" destination_password=\"initial_destination_password\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\">\n <StreamParam name=\"stream_param_name_1\" value=\"stream_param_value_1\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n <StreamParam name=\"stream_param_name_2\" value=\"stream_param_value_2\"/>\n</StartStream>\n" |
70 | 74 | instance_nested.add_stream_params([stream_param_2, stream_param_2]) |
71 | 75 | expect(instance_nested.to_bxml).to eq(expected_multiple) |
72 | 76 | end |
|
0 commit comments