Sha256: 8a115fa22c69832d84ae10493b0163839adbe4b5a26652c4b77e79bec7bed0fe

Contents?: true

Size: 1.71 KB

Versions: 39

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

39 entries across 37 versions & 6 rubygems

Version Path
fog-1.30.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.29.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.28.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.27.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.26.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.25.0 tests/rackspace/requests/monitoring/notification_tests.rb
nsidc-fog-1.24.1 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.24.0 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.11 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.10 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.9 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.8 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.7 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.6 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.23.0 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.4 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.3 tests/rackspace/requests/monitoring/notification_tests.rb
ns-fog-1.22.2 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.22.1 tests/rackspace/requests/monitoring/notification_tests.rb