Sha256: ebd2f10ac5834ccb1aedfc87ee3355c95a3afe709426bc313014ca1bdcfd3620

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

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

class NotificationTest < Test::Unit::TestCase #:nodoc: all
  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

7 entries across 7 versions & 2 rubygems

Version Path
webficient-twilio-1.2.0 test/twilio/notification_test.rb
webficient-twilio-1.3.0 test/twilio/notification_test.rb
webficient-twilio-1.4.0 test/twilio/notification_test.rb
webficient-twilio-2.0.0 test/twilio/notification_test.rb
webficient-twilio-2.1.0 test/twilio/notification_test.rb
webficient-twilio-2.2.0 test/twilio/notification_test.rb
twilio-1.4.0 test/twilio/notification_test.rb