Sha256: fd5ad8668af6ceb92669e48b788520bc13fc03d13458cfdecf0860cca81b90de

Contents?: true

Size: 665 Bytes

Versions: 21

Compression:

Stored size: 665 Bytes

Contents

module CcApiStub
  module SpaceUsers
    extend Helper

    class << self
      def succeed_to_delete(options = {})
        if options.has_key? :roles
          options[:roles].each do |role|
            stub_delete(object_endpoint(options[:id], role.to_s.pluralize), {}, response(200, ""))
          end
        end

        stub_delete(object_endpoint(options[:id]), {}, response(200, ""))
      end

      def fail_to_delete(options = {})
        stub_delete(object_endpoint(options[:id]), {}, response(500))
      end

      private

      def object_endpoint(id = nil, role="users")
        %r{/v2/spaces/[^/]+/#{role}/#{id}[^/]+$}
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
new_cfoundry-4.9.4 lib/cc_api_stub/space_users.rb
new_cfoundry-4.9.3 lib/cc_api_stub/space_users.rb
ncfoundry-4.9.4 lib/cc_api_stub/space_users.rb
ncfoundry-4.9.3 lib/cc_api_stub/space_users.rb
ncfoundry-4.9.2 lib/cc_api_stub/space_users.rb
new_cfoundry-4.9.2 lib/cc_api_stub/space_users.rb
new_cfoundry-4.9.1 lib/cc_api_stub/space_users.rb
new_cfoundry-4.9.0 lib/cc_api_stub/space_users.rb
new_cfoundry-4.8.3 lib/cc_api_stub/space_users.rb
new_cfoundry-4.8.2 lib/cc_api_stub/space_users.rb
cfoundry-4.7.2.rc1 lib/cc_api_stub/space_users.rb
cfoundry-4.7.1 lib/cc_api_stub/space_users.rb
cfoundry-4.7.1.rc1 lib/cc_api_stub/space_users.rb
cfoundry-4.7.0 lib/cc_api_stub/space_users.rb
cfoundry-4.6.3.rc3 lib/cc_api_stub/space_users.rb
cfoundry-4.6.3.rc2 lib/cc_api_stub/space_users.rb
cfoundry-4.6.3.rc1 lib/cc_api_stub/space_users.rb
cfoundry-4.6.2 lib/cc_api_stub/space_users.rb
cfoundry-4.6.1 lib/cc_api_stub/space_users.rb
cfoundry-4.6.0 lib/cc_api_stub/space_users.rb