spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.3.0 vs spec/adhearsion/call_controller/output_spec.rb in adhearsion-2.3.1
- old
+ new
@@ -690,16 +690,11 @@
Punchblock::Component::Input.new :mode => :dtmf,
:grammar => { :value => grammar.to_s }
}
def expect_component_complete_event
- complete_event = Punchblock::Event::Complete.new
- flexmock(complete_event).should_receive(:reason => flexmock(:utterance => 'dtmf-5'))
- flexmock(Punchblock::Component::Input).new_instances do |input|
- input.should_receive(:complete?).and_return(false)
- input.should_receive(:complete_event).and_return(complete_event)
- end
+ expect_input_component_complete_event 'dtmf-5'
end
#test does pass and method works, but not sure if the empty method is a good idea
it "plays the correct output" do
def controller.write_and_await_response(input_component)
@@ -715,10 +710,10 @@
def controller.write_and_await_response(input_component)
input_component.trigger_event_handler Punchblock::Event::Complete.new
end
expect_component_complete_event
- flexmock(Punchblock::Component::Output).new_instances.should_receive(:stop!)
+ Punchblock::Component::Output.any_instance.should_receive(:stop!)
expect_component_execution output_component
subject.stream_file(prompt, allowed_digits).should be == '5'
end
context "with output options passed in" do