Sha256: b4e6e20e6575c7e87d1b9ee30e85635d7bfd86ba096d44a99c61b09708c411de

Contents?: true

Size: 885 Bytes

Versions: 3

Compression:

Stored size: 885 Bytes

Contents

require 'spec_helper'

describe Smartdc::Api::Machines::Metadata do
  let(:id) do
    VCR.use_cassette('machines/index') { Smartdc.machines.content.first['id'] }
  end

  describe ".update_machine_metadata", vcr: { cassette_name: 'machines/metadata/update' } do
    let(:metadata) { { key: :value } }

    it "creates a new machine metadata" do
      expect(Smartdc.update_machine_metadata(id, metadata).content.count).to be > 0
    end
  end

  describe ".machine_metadata", vcr: { cassette_name: 'machines/metadata/index' } do
    it "receives list of machine metadata" do
      expect(Smartdc.machine_metadata(id).content.count).to be > 0
    end
  end

  describe ".destroy_machine_metadata", vcr: { cassette_name: 'machines/metadata/destroy' } do
    it "removes a machine metadata" do
      expect(Smartdc.destroy_machine_metadata(id, 'key').status).to eq(204)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smartdc-2.0.2 spec/smartdc/api/machines/metadata_spec.rb
smartdc-2.0.1 spec/smartdc/api/machines/metadata_spec.rb
smartdc-2.0.0 spec/smartdc/api/machines/metadata_spec.rb