Sha256: e3589c51b99da8c40c375c6e77db43eb77f24b91d76e9fc1c99c6366729ed48c

Contents?: true

Size: 1.44 KB

Versions: 10

Compression:

Stored size: 1.44 KB

Contents

require "spec_helper"

module CFoundry
  module V2
    describe Service do
      let(:client) { build(:client) }

      subject do
        build(:service)
      end

      before :each do
stub_request(:get, /\/services\/service-guid-\d{1,2}/).to_return :status => 200,
          :headers => {'Content-Type' => 'application/json'},
          :body => <<EOF
  {
    "metadata": {
      "guid": "d1251ac1-fe42-4b4a-84d4-e31e95b547d8",
      "url": "/v2/services/d1251ac1-fe42-4b4a-84d4-e31e95b547d8",
      "created_at": "2013-08-28T12:28:35+04:00",
      "updated_at": "2013-08-28T12:33:27+04:00"
    },
    "entity": {
      "label": "rabbitmq",
      "provider": "rabbitherd",
      "url": "http://rabbitmq.com",
      "description": "RabbitMQ service",
      "version": "1.0",
      "info_url": null,
      "active": true,
      "bindable": true,
      "unique_id": "0aa2f82c-6918-41df-b676-c275b5954ed7",
      "extra": "",
      "tags": [

      ],
      "documentation_url": null,
      "service_plans_url": "/v2/services/d1251ac1-fe42-4b4a-84d4-e31e95b547d8/service_plans"
    }
  }
EOF
      end

      let(:uuid) { "4692e0ca-25ed-495e-9ae1-fcb0bcf26a96" }

      it "has unique_id that can be mutated" do
        expect(subject.unique_id).to eq("0aa2f82c-6918-41df-b676-c275b5954ed7")

        subject.unique_id = uuid
        expect(subject.unique_id).to eq(uuid)
      end

      it "has tags" do
        expect(subject.tags).to eq([])
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
new_cfoundry-4.9.4 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.9.3 spec/cfoundry/v2/service_spec.rb
ncfoundry-4.9.4 spec/cfoundry/v2/service_spec.rb
ncfoundry-4.9.3 spec/cfoundry/v2/service_spec.rb
ncfoundry-4.9.2 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.9.2 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.9.1 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.9.0 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.8.3 spec/cfoundry/v2/service_spec.rb
new_cfoundry-4.8.2 spec/cfoundry/v2/service_spec.rb