Sha256: ce038411dc2b4416ea68a225e37fa8c76708d99320fb4c2d7d00ebb36d477b95

Contents?: true

Size: 1.39 KB

Versions: 39

Compression:

Stored size: 1.39 KB

Contents

require 'spec_helper'

describe "as a client" do
  let(:client)    { create_client }
  let!(:account)  { create_account(client: client) }
  let!(:provider) { create_provider(account: account) }

  context "with a database server" do
    let!(:database_service) { create_database_service(provider: provider, client: client) }
    let!(:database_server)  { database_service.servers.first }

    it "should discover database server snapshots", :mock_only do
      expect {
        snapshots = client.database_server_snapshots.discover(provider).resource!
        expect(snapshots).to be_a(Ey::Core::Client::DatabaseServerSnapshots)
        expect(snapshots.count).not_to eq(0)
      }.to change { database_server.snapshots.count }
    end

    it "creates a snapshot" do
      snapshot = database_server.snapshots.create.resource!

      expect(snapshot.database_server).to eq(database_server)
      expect(snapshot.database_service).to eq(database_service)
      expect(snapshot.provisioned_id).to be

      expect(database_service.snapshots).to contain_exactly(snapshot)
      expect(database_server.snapshots).to  contain_exactly(snapshot)
    end

    context "with a snapshot" do
      let!(:snapshot) { database_server.snapshots.create.resource! }

      it "destroys" do
        expect {
          snapshot.destroy!.resource!
        }.to change { snapshot.reload.deleted_at }.from(nil)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

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