Sha256: 61490d252c467953574cf7d7762a6449bcbdf233e93641ebf6849f8827d78107

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

require File.dirname(__FILE__) + '/../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

5 entries across 5 versions & 1 rubygems

Version Path
twilio-2.8.0 test/twilio/notification_test.rb
twilio-2.7.0 test/twilio/notification_test.rb
twilio-2.6.0 test/twilio/notification_test.rb
twilio-2.5.0 test/twilio/notification_test.rb
twilio-2.4.1 test/twilio/notification_test.rb