lib/cc_api_stub/spaces.rb in cfoundry-4.3.2.rc1 vs lib/cc_api_stub/spaces.rb in cfoundry-4.3.3
- old
+ new
@@ -3,11 +3,11 @@
extend Helper
class << self
def succeed_to_load(options={})
response_body = Helper.load_fixtures(options.delete(:fixture) || "fake_cc_#{object_name}", options)
- stub_get(object_endpoint, {}, response(200, response_body))
+ stub_get(object_endpoint(options[:id]), {}, response(200, response_body))
end
def succeed_to_create
response_body = Helper.load_fixtures("fake_cc_created_space")
stub_post(collection_endpoint, {}, response(201, response_body))
@@ -39,11 +39,11 @@
def collection_endpoint
%r{/v2/spaces$}
end
- def object_endpoint
- %r{/v2/spaces/[^/]+$}
+ def object_endpoint(id = nil)
+ %r{/v2/spaces/#{id}[^/]+$}
end
end
end
end