Sha256: bd57ad7c6cbfb025b923377ec0c443bdbb94b5862c8d5ee5eb8de97490631395

Contents?: true

Size: 1.36 KB

Versions: 20

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe 'as a user' do
  let(:client) { create_client }

  context "with an account", :mock_only do
    let!(:account)     { create_account(client: client) }
    let!(:provider)    { create_provider(account: account) }
    let!(:environment) { create_environment(account: account, name: Faker::Name.name) }
    let(:server)       { environment.servers.first }
    let(:legacy_alert) { client.legacy_alerts.get(1001) }

    before do
      create_legacy_alert(client, id: 1001,
                              type: "cpu",
                          severity: "warning",
                            server: server,
                      acknowledged: false)
    end

    it "fetches a legacy alert" do
      a = client.legacy_alerts.get(1001)

      expect(a).not_to be_nil
      expect(a.id).to          eq(1001)
      expect(a.type).to        eq("cpu")
      expect(a.severity).to    eq("warning")
      expect(a.acknowledged).to be false
      expect(a.server).to      eq(server)
    end

    it "lists legacy alerts" do
      legacy_alerts = client.legacy_alerts.all
      expect(legacy_alerts.size).to be(1)

      a = legacy_alerts.first
      expect(a.id).to          eq(1001)
      expect(a.type).to        eq("cpu")
      expect(a.severity).to    eq("warning")
      expect(a.acknowledged).to be false
      expect(a.server).to      eq(server)
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
ey-core-3.6.4 spec/legacy_alerts_spec.rb
ey-core-3.6.3 spec/legacy_alerts_spec.rb
ey-core-3.6.1 spec/legacy_alerts_spec.rb
groove-ey-core-3.6.3 spec/legacy_alerts_spec.rb
groove-ey-core-3.6.2 spec/legacy_alerts_spec.rb
groove-ey-core-3.6.1 spec/legacy_alerts_spec.rb
ey-core-3.5.0 spec/legacy_alerts_spec.rb
ey-core-3.4.4 spec/legacy_alerts_spec.rb
ey-core-3.4.2 spec/legacy_alerts_spec.rb
ey-core-3.4.1 spec/legacy_alerts_spec.rb
ey-core-3.4.0 spec/legacy_alerts_spec.rb
ey-core-3.3.1 spec/legacy_alerts_spec.rb
ey-core-3.3.0 spec/legacy_alerts_spec.rb
ey-core-3.2.6 spec/legacy_alerts_spec.rb
ey-core-3.2.5 spec/legacy_alerts_spec.rb
ey-core-3.2.4 spec/legacy_alerts_spec.rb
ey-core-3.2.3 spec/legacy_alerts_spec.rb
ey-core-3.2.2 spec/legacy_alerts_spec.rb
ey-core-3.2.1 spec/legacy_alerts_spec.rb
ey-core-3.2.0 spec/legacy_alerts_spec.rb