spec/adhearsion/call_controller/dial_spec.rb in adhearsion-2.1.2 vs spec/adhearsion/call_controller/dial_spec.rb in adhearsion-2.1.3

- old
+ new

@@ -87,10 +87,11 @@ latch.wait(1).should be_true end it "joins the new call to the existing one on answer" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) dial_in_thread latch.wait(1).should be_false @@ -100,10 +101,11 @@ latch.wait(1).should be_true end it "hangs up the new call when the dial unblocks" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) dial_in_thread latch.wait(1).should be_false @@ -146,10 +148,11 @@ end end context "when the call is answered and joined" do it "has an overall dial status of :answer" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) t = dial_in_thread sleep 0.5 @@ -206,10 +209,11 @@ status end end it "dials all parties and joins the first one to answer, hanging up the rest" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) flexmock(second_other_mock_call).should_receive(:hangup).once t = dial_in_thread @@ -230,10 +234,11 @@ status.should have(2).calls status.calls.each { |c| c.should be_a OutboundCall } end it "unblocks when the joined call unjoins, allowing it to proceed further" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) flexmock(second_other_mock_call).should_receive(:hangup).once t = dial_in_thread @@ -342,10 +347,11 @@ end end context "when a call is answered and joined, and the other ends with an error" do it "has an overall dial status of :answer" do + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) flexmock(second_other_mock_call).should_receive(:hangup).once t = dial_in_thread @@ -390,10 +396,11 @@ end describe "if someone answers before the timeout elapses" do it "should not abort until the far end hangs up" do flexmock(other_mock_call).should_receive(:dial).once.with(to, hsh(:timeout => timeout)) + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) flexmock(other_mock_call).should_receive(:hangup).once flexmock(OutboundCall).should_receive(:new).and_return other_mock_call time = Time.now @@ -462,10 +469,11 @@ end it "should join the calls if the call is still active after execution of the call controller" do flexmock(other_mock_call).should_receive(:hangup).once other_mock_call['confirm'] = true + flexmock(call).should_receive(:answer).once flexmock(other_mock_call).should_receive(:join).once.with(call) t = dial_in_thread latch.wait(1).should be_false @@ -483,9 +491,10 @@ it "should not join the calls if the call is not active after execution of the call controller" do flexmock(other_mock_call).should_receive(:hangup).twice.and_return do other_mock_call << mock_end end other_mock_call['confirm'] = false + flexmock(call).should_receive(:answer).never flexmock(other_mock_call).should_receive(:join).never.with(call) t = dial_in_thread latch.wait(1).should be_false