Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ def initialize(attributes = {})
super('StopStream', nil, attributes)

@attribute_map = {
name: 'name' # [String]: The name of the stream to stop. This is either the user selected name when sending the <StartStream> verb, or the system generated name returned in the Media Stream Started webhook if <StartStream> was sent with no name attribute.
name: 'name', # [String]: The name of the stream to stop. This is either the user selected name when sending the <StartStream> verb, or the system generated name returned in the Media Stream Started webhook if <StartStream> was sent with no name attribute.
wait: 'wait' # Optional [Boolean]: If true, the BXML interpreter will wait for the stream to stop before processing the next verb.
}
end
end
Expand Down
10 changes: 6 additions & 4 deletions spec/unit/models/bxml/verbs/stop_stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
describe 'Bandwidth::Bxml::StopStream' do
let(:initial_attributes) {
{
name: 'initial_name'
name: 'initial_name',
wait: true
}
}

let(:new_attributes) {
{
name: 'new_name'
name: 'new_name',
wait: false
}
}

Expand All @@ -21,13 +23,13 @@
end

it 'tests the to_bxml method of the StopStream instance' do
expected = "\n<StopStream name=\"initial_name\"/>\n"
expected = "\n<StopStream name=\"initial_name\" wait=\"true\"/>\n"
expect(instance.to_bxml).to eq(expected)
end

it 'tests the set_attributes method of the StopStream instance' do
instance.set_attributes(new_attributes)
expected = "\n<StopStream name=\"new_name\"/>\n"
expected = "\n<StopStream name=\"new_name\" wait=\"false\"/>\n"
expect(instance.to_bxml).to eq(expected)
end
end
Expand Down