spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.0.0.rc5 vs spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.0.0
- old
+ new
@@ -280,32 +280,30 @@
end
describe "#say" do
describe "with a RubySpeech document" do
it 'plays the correct SSML' do
- doc = RubySpeech::SSML.draw { string "Hello world" }
- subject.should_receive(:play_ssml).once.with(doc, {}).and_return true
- subject.should_receive(:output).never
- subject.say(doc).should be true
+ ssml = RubySpeech::SSML.draw { string "Hello world" }
+ expect_component_execution Punchblock::Component::Output.new(:ssml => ssml)
+ subject.say(ssml).should be_a Punchblock::Component::Output
end
end
describe "with a string" do
it 'outputs the correct text' do
- string = "Hello world"
- subject.should_receive(:play_ssml).once.with(string, {})
- subject.should_receive(:output).once.with(:text, string, {}).and_return true
- subject.say(string).should be true
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_component_execution Punchblock::Component::Output.new(:ssml => ssml)
+ subject.say(str).should be_a Punchblock::Component::Output
end
end
describe "converts the argument to a string" do
it 'calls output with a string' do
- expected_string = "123"
argument = 123
- subject.should_receive(:play_ssml).once.with(argument, {})
- subject.should_receive(:output).once.with(:text, expected_string, {}).and_return true
- subject.say(argument)
+ ssml = RubySpeech::SSML.draw { string '123' }
+ expect_component_execution Punchblock::Component::Output.new(:ssml => ssml)
+ subject.say(argument).should be_a Punchblock::Component::Output
end
end
end
describe "#ssml_for" do