|
3 | 3 | let(:initial_attributes) { |
4 | 4 | { |
5 | 5 | name: 'initial_name', |
| 6 | + mode: 'unidirectional', |
6 | 7 | tracks: 'inbound', |
7 | 8 | destination: 'https://initial.com', |
8 | 9 | stream_event_url: 'https://initial.com', |
|
15 | 16 | let(:new_attributes) { |
16 | 17 | { |
17 | 18 | name: 'new_name', |
| 19 | + mode: 'bidirectional', |
18 | 20 | tracks: 'outbound', |
19 | 21 | destination: 'https://new.com', |
20 | 22 | stream_event_url: 'https://new.com', |
|
37 | 39 | end |
38 | 40 |
|
39 | 41 | it 'tests the to_bxml method of the StartStream instance' do |
40 | | - expected = "\n<StartStream name=\"initial_name\" tracks=\"inbound\" destination=\"https://initial.com\" streamEventUrl=\"https://initial.com\" streamEventMethod=\"POST\" username=\"initial_username\" password=\"initial_password\"/>\n" |
| 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" |
41 | 43 | expect(instance.to_bxml).to eq(expected) |
42 | 44 | end |
43 | 45 |
|
44 | 46 | it 'tests the set_attributes method of the StartStream instance' do |
45 | 47 | instance.set_attributes(new_attributes) |
46 | | - expected = "\n<StartStream name=\"new_name\" tracks=\"outbound\" destination=\"https://new.com\" streamEventUrl=\"https://new.com\" streamEventMethod=\"GET\" username=\"new_username\" password=\"new_password\"/>\n" |
| 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" |
47 | 49 | expect(instance.to_bxml).to eq(expected) |
48 | 50 | end |
49 | 51 | end |
|
55 | 57 | end |
56 | 58 |
|
57 | 59 | it 'tests the to_bxml method of the nested StartStream instance' do |
58 | | - expected = "\n<StartStream name=\"initial_name\" 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" |
| 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" |
59 | 61 | expect(instance_nested.to_bxml).to eq(expected) |
60 | 62 | end |
61 | 63 |
|
62 | 64 | it 'tests the add_stream_param method of the nested StartStream instance' do |
63 | | - expected_single = "\n<StartStream name=\"initial_name\" 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" |
| 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" |
64 | 66 | instance_nested.add_stream_params(stream_param_2) |
65 | 67 | expect(instance_nested.to_bxml).to eq(expected_single) |
66 | 68 |
|
67 | | - expected_multiple = "\n<StartStream name=\"initial_name\" 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" |
| 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" |
68 | 70 | instance_nested.add_stream_params([stream_param_2, stream_param_2]) |
69 | 71 | expect(instance_nested.to_bxml).to eq(expected_multiple) |
70 | 72 | end |
|
0 commit comments