Sha256: cd62ec0e28e9911c131ec3c3a87b3595d3a216d199a1ca8e208e1b892d3cfccf

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

RSpec::Matchers.define :complete_hold do |expected|
  chain :with_id do |id|
    @id = id
  end

  match do |actual|
    xml = Nokogiri::XML response.body
    enqueue = xml.at('/Response/Enqueue')
    enqueue.text.should == 'hold'
    enqueue.attributes['action'].value.should =~ %r{/zestphone/providers/twilio/calls/\d+/leave_queue}
  end

  failure_message_for_should do |actual|
    "expected that '#{actual}' would be put in the hold queue"
  end

  failure_message_for_should_not do |actual|
    "expected that '#{actual}' would not be put in the hold queue"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
telephony-1.0.4 spec/support/matchers/be_complete_hold.rb
telephony-1.0.3 spec/support/matchers/be_complete_hold.rb