Sha256: 52961c5ae63b714fae396e14d5dcae70f31444d13939c880dd5700ae23469dba

Contents?: true

Size: 760 Bytes

Versions: 1

Compression:

Stored size: 760 Bytes

Contents

require 'spec_helper'

describe Smartdc::Api::Datacenters do

  let(:object) {Object.new}
  let(:request) {Smartdc::Request}
  let(:datacenters) {Smartdc::Api::Datacenters.new({})}

  describe ".read" do
    it "returns a datacenter" do
      object.stub(:content) {fixture('datacenter')}
      name = fixture('datacenters').first[0]
      request.stub_chain(:new, :get).with('my/datacenters/' + name) {object}

      expect(datacenters.read(name).content['message']).to match(/#{name}/)
    end
  end

  describe ".all" do
    it "returns some datacenter" do
      object.stub(:content) {fixture('datacenters')}
      request.stub_chain(:new, :get).with('my/datacenters', {}) {object}

      expect(datacenters.all.content.count).to be > 0
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smartdc-1.3.0 spec/unit/smartdc/api/datacenters_spec.rb