spec/adhearsion/call_spec.rb in adhearsion-2.6.2 vs spec/adhearsion/call_spec.rb in adhearsion-2.6.3
- old
+ new
@@ -550,12 +550,28 @@
expect(subject.peers).not_to be subject.peers
end
end
describe "#<<" do
+ describe "with a Punchblock Complete Event and Reason Hangup" do
+ let :complete_event do
+ Punchblock::Event::Complete.new :reason => Punchblock::Event::Complete::Hangup.new
+ end
+
+ it "should mark the call as terminating" do
+ subject << complete_event
+ expect(subject.terminating?).to be true
+ end
+ end
+
describe "with a Punchblock End" do
let :end_event do
Punchblock::Event::End.new :reason => :hangup, :platform_code => 'arbitrary_code'
+ end
+
+ it "should mark the call as terminating" do
+ subject << end_event
+ expect(subject.terminating?).to be true
end
it "should mark the call as ended" do
subject << end_event
expect(subject).not_to be_active