lib/cc_api_stub/applications.rb in cfoundry-4.3.2.rc1 vs lib/cc_api_stub/applications.rb in cfoundry-4.3.3
- old
+ new
@@ -3,21 +3,21 @@
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_application")
stub_post(%r{/v2/apps$}, nil, response(201, response_body))
end
def succeed_to_update(options={})
response_body = Helper.load_fixtures(:fake_cc_application, options)
- stub_put(object_endpoint, nil, response(200, response_body))
+ stub_put(object_endpoint(options[:id]), nil, response(200, response_body))
end
def succeed_to_map_route
stub_put(%r{/v2/apps/[^/]+/routes/[^/]+$}, {}, response(201, {}))
end
@@ -43,11 +43,11 @@
stub_get(%r{/v2/apps/[^/]+/service_bindings/?(?:\?.+)?$}, {}, response(200, response_body))
end
private
- def object_endpoint
- %r{/v2/apps/[^/]+$}
+ def object_endpoint(id = nil)
+ %r{/v2/apps/#{id}[^/]+$}
end
end
end
end