spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.4.0.beta2 vs spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.4.0.beta3
- old
+ new
@@ -746,11 +746,11 @@
expect_ssml_output ssml
subject.say(str).should be_a Punchblock::Component::Output
end
end
- describe "with a default voice set" do
+ describe "with a default voice set in PB config" do
before { Adhearsion.config.punchblock.default_voice = 'foo' }
it 'sets the voice on the output component' do
str = "Hello world"
ssml = RubySpeech::SSML.draw { string str }
@@ -759,10 +759,61 @@
end
after { Adhearsion.config.punchblock.default_voice = nil }
end
+ describe "with a default voice set in core and PB config" do
+ before do
+ Adhearsion.config.punchblock.default_voice = 'foo'
+ Adhearsion.config.platform.media.default_voice = 'bar'
+ end
+
+ it 'prefers core config to set the voice on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_ssml_output ssml, voice: 'bar'
+ subject.say(str)
+ end
+
+ after do
+ Adhearsion.config.punchblock.default_voice = nil
+ Adhearsion.config.platform.media.default_voice = nil
+ end
+ end
+
+ describe "with a default media engine set in PB config" do
+ before { Adhearsion.config.punchblock.media_engine = 'foo' }
+
+ it 'sets the renderer on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_ssml_output ssml, renderer: 'foo'
+ subject.say(str)
+ end
+
+ after { Adhearsion.config.punchblock.media_engine = nil }
+ end
+
+ describe "with a default renderer set in core and PB config" do
+ before do
+ Adhearsion.config.punchblock.media_engine = 'foo'
+ Adhearsion.config.platform.media.default_renderer = 'bar'
+ end
+
+ it 'prefers core config to set the renderer on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_ssml_output ssml, renderer: 'bar'
+ subject.say(str)
+ end
+
+ after do
+ Adhearsion.config.punchblock.media_engine = nil
+ Adhearsion.config.platform.media.default_renderer = nil
+ end
+ end
+
describe "converts the argument to a string" do
it 'calls output with a string' do
argument = 123
ssml = RubySpeech::SSML.draw { string '123' }
expect_ssml_output ssml
@@ -793,20 +844,71 @@
expect_async_ssml_output ssml
subject.say!(str).should be_a Punchblock::Component::Output
end
end
- describe "with a default voice set" do
+ describe "with a default voice set in PB config" do
before { Adhearsion.config.punchblock.default_voice = 'foo' }
it 'sets the voice on the output component' do
str = "Hello world"
ssml = RubySpeech::SSML.draw { string str }
expect_async_ssml_output ssml, voice: 'foo'
subject.say!(str)
end
after { Adhearsion.config.punchblock.default_voice = nil }
+ end
+
+ describe "with a default voice set in core and PB config" do
+ before do
+ Adhearsion.config.punchblock.default_voice = 'foo'
+ Adhearsion.config.platform.media.default_voice = 'bar'
+ end
+
+ it 'prefers core config to set the voice on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_async_ssml_output ssml, voice: 'bar'
+ subject.say!(str)
+ end
+
+ after do
+ Adhearsion.config.punchblock.default_voice = nil
+ Adhearsion.config.platform.media.default_voice = nil
+ end
+ end
+
+ describe "with a default media engine set in PB config" do
+ before { Adhearsion.config.punchblock.media_engine = 'foo' }
+
+ it 'sets the renderer on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_async_ssml_output ssml, renderer: 'foo'
+ subject.say!(str)
+ end
+
+ after { Adhearsion.config.punchblock.media_engine = nil }
+ end
+
+ describe "with a default renderer set in core and PB config" do
+ before do
+ Adhearsion.config.punchblock.media_engine = 'foo'
+ Adhearsion.config.platform.media.default_renderer = 'bar'
+ end
+
+ it 'prefers core config to set the renderer on the output component' do
+ str = "Hello world"
+ ssml = RubySpeech::SSML.draw { string str }
+ expect_async_ssml_output ssml, renderer: 'bar'
+ subject.say!(str)
+ end
+
+ after do
+ Adhearsion.config.punchblock.media_engine = nil
+ Adhearsion.config.platform.media.default_renderer = nil
+ end
end
describe "converts the argument to a string" do
it 'calls output with a string' do
argument = 123