Sha256: a4559739894e3edda780e4f8ac874f0c159515af400379c600a2fd16326f562c

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

class NotificationTest < Test::Unit::TestCase
  context "A recording" do
    setup do
      @connection = Twilio::Connection.new('mysid', 'mytoken')
      @notification = Twilio::Notification.new(@connection)
    end

    should "be retrievable as a list" do
      fake_response = fixture(:notifications)
      FakeWeb.register_uri(:get, twilio_url('Notifications'), :string => fake_response)
      assert_equal @notification.list, fake_response
    end
    
    should "be retrievable individually" do
      fake_response = fixture(:notification)
      FakeWeb.register_uri(:get, twilio_url('Notifications/NO1fb7086ceb85caed2265f17d7bf7981c'), :string => fake_response)
      assert_equal @notification.get('NO1fb7086ceb85caed2265f17d7bf7981c'), fake_response
    end
    
    should "be deleted" do
      FakeWeb.register_uri(:delete, twilio_url('Notifications/NO1fb7086ceb85caed2265f17d7bf7981c'), :status => [ 204, "HTTPNoContent" ])
      response = @notification.delete('NO1fb7086ceb85caed2265f17d7bf7981c')
      assert response
    end    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webficient-twilio-1.0.0 test/twilio/notification_test.rb