Sha256: 82bed1399a3eae463d3ccd8ad30d8a29786951fc4e67261cb7046d3107ab2773

Contents?: true

Size: 1.71 KB

Versions: 40

Compression:

Stored size: 1.71 KB

Contents

Shindo.tests('Fog::Rackspace::Monitoring | notification_tests', ['rackspace','rackspace_monitoring']) do
  account = Fog::Rackspace::Monitoring.new
  notification_id = nil
  tests('success') do
    tests('#create new notification').formats(DATA_FORMAT) do
      pending if Fog.mocking?
      response = account.create_notification(:label => "Foo", :type => "email", :details => {:address => "test@test.com"}).data
      
      notification_id = response[:headers]["X-Object-ID"]
      response
    end
    tests('#get notification').formats(LIST_HEADERS_FORMAT) do
      account.get_notification(notification_id).data[:headers]
    end
    tests('#update notification').formats(DATA_FORMAT) do
      pending if Fog.mocking?

      options = {:testing => "Bar"}
      account.update_notification(notification_id,options).data
    end
    tests('#delete notification').formats(DELETE_DATA_FORMAT) do
      pending if Fog.mocking?
      account.delete_notification(notification_id).data
    end
  end
  tests('failure') do
    tests('#create new notification(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
      pending if Fog.mocking?
      account.create_notification(:label => "")
    end
    tests('#get notification(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      pending if Fog.mocking?

      account.get_notification(-1)
    end
    tests('#update invalid notification(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      pending if Fog.mocking?
      options = { :testing => "Bar" }
      response = account.update_notification(-1,options)
    end
    tests('#delete notification(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
      pending if Fog.mocking?
      account.delete_notification(-1)
    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
fog-1.22.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.21.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.20.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.19.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/rackspace/requests/monitoring/notification_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/rackspace/requests/monitoring/notification_tests.rb