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-rackspace-0.1.6 tests/rackspace/requests/monitoring/notification_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/notification_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/notification_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.5 tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.4 tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.3 tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.2 tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.1 tests/rackspace/requests/monitoring/notification_tests.rb
fog-rackspace-0.1.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.37.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.36.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.35.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-2.0.0.pre.0 tests/rackspace/requests/monitoring/notification_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.34.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.33.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.32.0 tests/rackspace/requests/monitoring/notification_tests.rb
fog-1.31.0 tests/rackspace/requests/monitoring/notification_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/requests/monitoring/notification_tests.rb