Sha256: aff8e38df89ea61b31c8472f50a4803cd172f468bf861c8db3d2a30205aec745

Contents?: true

Size: 1.27 KB

Versions: 27

Compression:

Stored size: 1.27 KB

Contents

require "spec_helper"

describe CFoundry::V2::QuotaDefinition do
  let(:client) { fake_client }

  subject { CFoundry::V2::QuotaDefinition.new("quota-definition-1", client) }

  it "has guid" do
    expect(subject.guid).to eq("quota-definition-1")
  end

  it "has name" do
    subject.name = "name"
    expect(subject.name).to eq("name")
  end

  it "has non_basic_services_allowed" do
    [true, false].each do |v|
      subject.non_basic_services_allowed = v
      expect(subject.non_basic_services_allowed).to eq(v)
    end
  end

  it "has total_services" do
    [0, 1].each do |v|
      subject.total_services = v
      expect(subject.total_services).to eq(v)
    end
  end

  it "has total_services" do
    [0, 1].each do |v|
      subject.total_services = v
      expect(subject.total_services).to eq(v)
    end
  end

  describe "querying" do
    let(:foo) { fake(:quota_definition, :name => "foo") }
    let(:bar) { fake(:quota_definition, :name => "bar") }
    let(:baz) { fake(:quota_definition, :name => "baz") }

    let(:quota_definitions) { [foo, bar, baz] }

    let(:client) { fake_client :quota_definitions => quota_definitions }

    it "is queryable by name" do
      quota = quota_definitions.last
      expect(client.quota_definition_by_name("bar")).to eq(bar)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cfoundry-1.5.3 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.5.2 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.5.1 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.5.0 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.4.0 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.3.0 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.2.0 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.1.0.rc4 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.1.0.rc3 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.1.0.rc2 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.1.0.rc1 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-1.0.0 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc15 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc14 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc13 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc12 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc11 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc10 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc9 spec/cfoundry/v2/quota_definition_spec.rb
cfoundry-0.7.0.rc8 spec/cfoundry/v2/quota_definition_spec.rb