Sha256: 947422403907bc745c1e55fae59217a00d11cdd2caeb39d369eb875df0026e5f

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

require 'test_helper'

class NotificationTest < Test::Unit::TestCase #:nodoc: all
  context "A recording" do
    setup do
      Twilio.connect('mysid', 'mytoken')
    end

    should "be retrievable as a list" do
      assert_equal stub_response(:get, :notifications, :resource => 'Notifications'), Twilio::Notification.list
    end
    
    should "be retrievable individually" do
      assert_equal stub_response(:get, :notification, :resource => 'Notifications/NO1fb7086ceb85caed2265f17d7bf7981c'), 
        Twilio::Notification.get('NO1fb7086ceb85caed2265f17d7bf7981c')
    end
    
    should "be deleted" do
      stub_response(:delete, :notification, { :resource => 'Notifications/NO1fb7086ceb85caed2265f17d7bf7981c', 
                                              :status   => [ 204, "HTTPNoContent" ] })
      assert Twilio::Notification.delete('NO1fb7086ceb85caed2265f17d7bf7981c')
    end
    
    context "using deprecated API" do
      setup do
        @connection = Twilio::Connection.new('mysid', 'mytoken')
        @notification = Twilio::Notification.new(@connection)
      end

      should "be retrievable as a list" do
        assert_equal stub_response(:get, :notifications, :resource => 'Notifications'), @notification.list
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twilio-2.9.0 test/twilio/notification_test.rb