Sha256: fc5a211fa3c6a38b4f17708a39570b5209b4907dd671014f9a4739a1c341542b

Contents?: true

Size: 878 Bytes

Versions: 44

Compression:

Stored size: 878 Bytes

Contents

module CcApiStub
  module Domains
    extend Helper

    class << self
      def succeed_to_create
        response_body = Helper.load_fixtures("fake_cc_created_domain")
        stub_post(%r{/v2/domains/?(\?.+)?$}, {}, response(201, response_body))
      end

      def succeed_to_delete
        stub_delete(%r{/v2/domains/[^/\?]+$}, {}, response(200))
      end

      def succeed_to_load_spaces
        response_body = Helper.load_fixtures("fake_cc_domain_spaces")
        stub_get(%r{/v2/domains/[^/]+/spaces.*$}, {}, response(200, response_body))
      end

      def succeed_to_add_space
        response_body = Helper.load_fixtures("fake_cc_created_domain")
        stub_put(%r{/v2/domains/[^/]+/spaces/[^/]+$}, {}, response(201, response_body))
      end

      private

      def object_endpoint(id = nil)
        %r{/v2/domains/#{id}[^/]+$}
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
cfoundry-4.6.1 lib/cc_api_stub/domains.rb
cfoundry-4.6.0 lib/cc_api_stub/domains.rb
cfoundry-4.5.3 lib/cc_api_stub/domains.rb
cfoundry-4.5.2 lib/cc_api_stub/domains.rb
cfoundry-4.5.1 lib/cc_api_stub/domains.rb
cfoundry-4.5.0 lib/cc_api_stub/domains.rb
cfoundry-4.3.12 lib/cc_api_stub/domains.rb
cfoundry-4.3.11 lib/cc_api_stub/domains.rb
cfoundry-4.3.10 lib/cc_api_stub/domains.rb
cfoundry-4.3.9 lib/cc_api_stub/domains.rb
cfoundry-4.3.8 lib/cc_api_stub/domains.rb
jfoundry-0.1.4 lib/cc_api_stub/domains.rb
jfoundry-0.1.3 lib/cc_api_stub/domains.rb
cfoundry-4.3.7 lib/cc_api_stub/domains.rb
jfoundry-0.1.2 lib/cc_api_stub/domains.rb
jfoundry-0.1.1 lib/cc_api_stub/domains.rb
jfoundry-0.1.0.pre lib/cc_api_stub/domains.rb
jfoundry-0.1.0 lib/cc_api_stub/domains.rb
cfoundry-4.3.6 lib/cc_api_stub/domains.rb
cfoundry-4.3.5 lib/cc_api_stub/domains.rb