Module: CcApiStub::Domains

Extended by:
Helper
Defined in:
lib/cc_api_stub/domains.rb

Class Method Summary collapse

Methods included from Helper

fail_request, fail_to_load, fail_to_load_many, fail_to_update, fail_with_error, find_fixture, fixture_prefix, host, host=, load_fixtures, object_class, object_name, response, response, stub_delete, stub_get, stub_post, stub_put, stub_request, succeed_to_create, succeed_to_delete, succeed_to_load, succeed_to_load_empty, succeed_to_load_many, succeed_to_update

Class Method Details

.succeed_to_add_spaceObject



20
21
22
23
# File 'lib/cc_api_stub/domains.rb', line 20

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

.succeed_to_createObject



6
7
8
9
# File 'lib/cc_api_stub/domains.rb', line 6

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

.succeed_to_deleteObject



11
12
13
# File 'lib/cc_api_stub/domains.rb', line 11

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

.succeed_to_load_spacesObject



15
16
17
18
# File 'lib/cc_api_stub/domains.rb', line 15

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