cfoundry 0.5.3.rc5 → 0.5.3.rc6

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,6 +11,11 @@ module CcApiStub
11
11
  def succeed_to_delete
12
12
  stub_delete(%r{/v2/domains/[^/\?]+$}, {}, response(200))
13
13
  end
14
+
15
+ def succeed_to_load_spaces
16
+ response_body = Helper.load_fixtures("fake_cc_domain_spaces")
17
+ stub_get(%r{/v2/domains/[^/]+/spaces.*$}, {}, response(200, response_body))
18
+ end
14
19
  end
15
20
  end
16
21
  end
@@ -100,7 +100,7 @@ module CcApiStub
100
100
  end
101
101
 
102
102
  def succeed_to_load_many(options={})
103
- response_body = CcApiStub::Helper.load_fixtures(options.delete(:fixture) || "fake_#{object_name.pluralize}", options)
103
+ response_body = CcApiStub::Helper.load_fixtures(options.delete(:fixture) || "fake_cc_#{object_name.pluralize}", options)
104
104
  stub_get(collection_endpoint, {}, response(200, response_body))
105
105
  end
106
106
 
@@ -208,7 +208,7 @@ module CFoundry
208
208
  end
209
209
 
210
210
  def all_files(path)
211
- Dir.glob("#{path}/**/*", File::FNM_DOTMATCH).reject! do |fn|
211
+ Dir.glob("#{path}/**/*", File::FNM_DOTMATCH).reject do |fn|
212
212
  fn =~ /\.$/
213
213
  end
214
214
  end
@@ -5,7 +5,8 @@ module CFoundry::V2
5
5
  attribute :name, :string
6
6
  attribute :wildcard, :boolean
7
7
  to_one :owning_organization, :as => :organization, :default => nil
8
+ to_many :spaces
8
9
 
9
10
  queryable_by :name, :owning_organization_guid, :space_guid
10
11
  end
11
- end
12
+ end
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "0.5.3.rc5".freeze
3
+ VERSION = "0.5.3.rc6".freeze
4
4
  end
@@ -16,4 +16,11 @@ describe CcApiStub::Domains do
16
16
 
17
17
  it_behaves_like "a stubbed delete request"
18
18
  end
19
+
20
+ describe ".succeed_to_load_spaces" do
21
+ let(:url) { "http://example.com/v2/domains/domain-id-1/spaces?inline-relationship-depth=1" }
22
+ subject { CcApiStub::Domains.succeed_to_load_spaces }
23
+
24
+ it_behaves_like "a stubbed get request"
25
+ end
19
26
  end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ describe CFoundry::V2::Domain do
4
+ let(:client) { fake_client }
5
+
6
+ subject { CFoundry::V2::Domain.new("domain-id-1", client) }
7
+
8
+ it "should have a spaces association" do
9
+ expect(subject.spaces).to eq([])
10
+ end
11
+ end
@@ -0,0 +1,35 @@
1
+ {
2
+ "metadata": {
3
+ "guid": "domain-id-1",
4
+ "url": "/v2/domains/domain-id-1",
5
+ "created_at": "2012-09-19 21:03:47 +0000",
6
+ "updated_at": null
7
+ },
8
+ "entity": {
9
+ "name": "domain.com",
10
+ "owning_organization_guid": "organization-id-1",
11
+ "wildcard": true,
12
+ "spaces_url": "/v2/domains/domain-id-1/spaces",
13
+ "spaces": [
14
+ {
15
+ "metadata": {
16
+ "guid": "space-id-1",
17
+ "url": "/v2/spaces/space-id-1",
18
+ "created_at": "2013-03-11 12:17:38 -0700",
19
+ "updated_at": null
20
+ },
21
+ "entity": {
22
+ "name": "development",
23
+ "organization_guid": "organization-id-1",
24
+ "developers_url": "/v2/spaces/space-id-1/developers",
25
+ "managers_url": "/v2/spaces/space-id-1/managers",
26
+ "auditors_url": "/v2/spaces/space-id-1/auditors",
27
+ "apps_url": "/v2/spaces/space-id-1/apps",
28
+ "domains_url": "/v2/spaces/space-id-1/domains",
29
+ "service_instances_url": "/v2/spaces/space-id-1/service_instances",
30
+ "organization_url": "/v2/organizations/organization-id-1"
31
+ }
32
+ }
33
+ ]
34
+ }
35
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "total_results": 1,
3
+ "total_pages": 1,
4
+ "prev_url": null,
5
+ "next_url": null,
6
+ "resources": [
7
+ {
8
+ "metadata": {
9
+ "guid": "space-id-1",
10
+ "url": "/v2/spaces/space-id-1",
11
+ "created_at": "2013-03-11 12:17:38 -0700",
12
+ "updated_at": null
13
+ },
14
+ "entity": {
15
+ "name": "development",
16
+ "organization_guid": "organization-id-1",
17
+ "developers_url": "/v2/spaces/space-id-1/developers",
18
+ "managers_url": "/v2/spaces/space-id-1/managers",
19
+ "auditors_url": "/v2/spaces/space-id-1/auditors",
20
+ "apps_url": "/v2/spaces/space-id-1/apps",
21
+ "domains_url": "/v2/spaces/space-id-1/domains",
22
+ "service_instances_url": "/v2/spaces/space-id-1/service_instances",
23
+ "organization_url": "/v2/organizations/organization-id-1"
24
+ }
25
+ }
26
+ ]
27
+ }
@@ -14,7 +14,9 @@
14
14
  "entity": {
15
15
  "name": "domain.com",
16
16
  "owning_organization_guid": null,
17
- "wildcard": true
17
+ "wildcard": true,
18
+ "spaces_url": "/v2/domains/domain-id-1/spaces",
19
+ "spaces": []
18
20
  }
19
21
  },
20
22
  {
@@ -27,7 +29,29 @@
27
29
  "entity": {
28
30
  "name": "domain2.com",
29
31
  "owning_organization_guid": "organization-id-1",
30
- "wildcard": true
32
+ "wildcard": true,
33
+ "spaces_url": "/v2/domains/domain-id-2/spaces",
34
+ "spaces": [
35
+ {
36
+ "metadata": {
37
+ "guid": "space-id-1",
38
+ "url": "/v2/spaces/space-id-1",
39
+ "created_at": "2013-03-11 12:17:38 -0700",
40
+ "updated_at": null
41
+ },
42
+ "entity": {
43
+ "name": "development",
44
+ "organization_guid": "organization-id-1",
45
+ "developers_url": "/v2/spaces/space-id-1/developers",
46
+ "managers_url": "/v2/spaces/space-id-1/managers",
47
+ "auditors_url": "/v2/spaces/space-id-1/auditors",
48
+ "apps_url": "/v2/spaces/space-id-1/apps",
49
+ "domains_url": "/v2/spaces/space-id-1/domains",
50
+ "service_instances_url": "/v2/spaces/space-id-1/service_instances",
51
+ "organization_url": "/v2/organizations/organization-id-1"
52
+ }
53
+ }
54
+ ]
31
55
  }
32
56
  }
33
57
  ]
@@ -0,0 +1,92 @@
1
+ [
2
+ {
3
+ "metadata": {
4
+ "guid": "space-id-1",
5
+ "url": "/v2/spaces/space-id-1",
6
+ "created_at": "2012-10-25 14:10:45 -0700",
7
+ "updated_at": null
8
+ },
9
+ "entity": {
10
+ "name": "space-name-1",
11
+ "organization_guid": "organization-id-1",
12
+ "domains_url": "/v2/spaces/space-id-1/domains",
13
+ "domains": [
14
+ {
15
+ "metadata": {
16
+ "guid": "domain-id-1",
17
+ "url": "/v2/domains/domain-id-1",
18
+ "created_at": "2012-10-25 14:08:38 -0700",
19
+ "updated_at": null
20
+ },
21
+ "entity": {
22
+ "name": "vcap.me",
23
+ "owning_organization_guid": null
24
+ }
25
+ }
26
+ ],
27
+ "organization_url": "/v2/organizations/organization-id-1",
28
+ "organization": {
29
+ "metadata": {
30
+ "guid": "organization-id-1",
31
+ "url": "/v2/organizations/organization-id-1",
32
+ "created_at": "2012-10-25 14:10:41 -0700",
33
+ "updated_at": null
34
+ },
35
+ "entity": {
36
+ "name": "organization-name-1",
37
+ "spaces_url": "/v2/organizations/organization-id-1/spaces",
38
+ "domains_url": "/v2/organizations/organization-id-1/domains",
39
+ "users_url": "/v2/organizations/organization-id-1/users",
40
+ "managers_url": "/v2/organizations/organization-id-1/managers",
41
+ "billing_managers_url": "/v2/organizations/organization-id-1/billing_managers",
42
+ "auditors_url": "/v2/organizations/organization-id-1/auditors"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "metadata": {
49
+ "guid": "space-id-2",
50
+ "url": "/v2/spaces/space-id-2",
51
+ "created_at": "2012-10-25 14:10:45 -0700",
52
+ "updated_at": null
53
+ },
54
+ "entity": {
55
+ "name": "space-name-2",
56
+ "organization_guid": "organization-id-1",
57
+ "domains_url": "/v2/spaces/space-id-2/domains",
58
+ "domains": [
59
+ {
60
+ "metadata": {
61
+ "guid": "domain-id-1",
62
+ "url": "/v2/domains/domain-id-1",
63
+ "created_at": "2012-10-25 14:08:38 -0700",
64
+ "updated_at": null
65
+ },
66
+ "entity": {
67
+ "name": "vcap.me",
68
+ "owning_organization_guid": null
69
+ }
70
+ }
71
+ ],
72
+ "organization_url": "/v2/organizations/organization-id-1",
73
+ "organization": {
74
+ "metadata": {
75
+ "guid": "organization-id-1",
76
+ "url": "/v2/organizations/organization-id-1",
77
+ "created_at": "2012-10-25 14:10:41 -0700",
78
+ "updated_at": null
79
+ },
80
+ "entity": {
81
+ "name": "organization-name-1",
82
+ "spaces_url": "/v2/organizations/organization-id-1/spaces",
83
+ "domains_url": "/v2/organizations/organization-id-1/domains",
84
+ "users_url": "/v2/organizations/organization-id-1/users",
85
+ "managers_url": "/v2/organizations/organization-id-1/managers",
86
+ "billing_managers_url": "/v2/organizations/organization-id-1/billing_managers",
87
+ "auditors_url": "/v2/organizations/organization-id-1/auditors"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ]
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- hash: -2049338452
4
+ hash: 1327074651
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 3
10
10
  - rc
11
- - 5
12
- version: 0.5.3.rc5
11
+ - 6
12
+ version: 0.5.3.rc6
13
13
  platform: ruby
14
14
  authors:
15
15
  - Cloud Foundry Team
@@ -18,10 +18,12 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2013-03-14 00:00:00 Z
21
+ date: 2013-03-21 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ name: multipart-post
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
25
27
  none: false
26
28
  requirements:
27
29
  - - ~>
@@ -31,12 +33,12 @@ dependencies:
31
33
  - 1
32
34
  - 1
33
35
  version: "1.1"
34
- prerelease: false
35
36
  type: :runtime
36
- name: multipart-post
37
- requirement: *id001
37
+ version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ name: multi_json
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
42
44
  - - ~>
@@ -46,12 +48,12 @@ dependencies:
46
48
  - 1
47
49
  - 3
48
50
  version: "1.3"
49
- prerelease: false
50
51
  type: :runtime
51
- name: multi_json
52
- requirement: *id002
52
+ version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ name: rubyzip
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
55
57
  none: false
56
58
  requirements:
57
59
  - - ~>
@@ -61,28 +63,28 @@ dependencies:
61
63
  - 0
62
64
  - 9
63
65
  version: "0.9"
64
- prerelease: false
65
66
  type: :runtime
66
- name: rubyzip
67
- requirement: *id003
67
+ version_requirements: *id003
68
68
  - !ruby/object:Gem::Dependency
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ name: cf-uaa-lib
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
70
72
  none: false
71
73
  requirements:
72
74
  - - ~>
73
75
  - !ruby/object:Gem::Version
74
- hash: 11
76
+ hash: 15
75
77
  segments:
76
78
  - 1
77
79
  - 3
78
- - 8
79
- version: 1.3.8
80
- prerelease: false
80
+ - 10
81
+ version: 1.3.10
81
82
  type: :runtime
82
- name: cf-uaa-lib
83
- requirement: *id004
83
+ version_requirements: *id004
84
84
  - !ruby/object:Gem::Dependency
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ name: rake
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
86
88
  none: false
87
89
  requirements:
88
90
  - - ~>
@@ -92,12 +94,12 @@ dependencies:
92
94
  - 0
93
95
  - 9
94
96
  version: "0.9"
95
- prerelease: false
96
97
  type: :development
97
- name: rake
98
- requirement: *id005
98
+ version_requirements: *id005
99
99
  - !ruby/object:Gem::Dependency
100
- version_requirements: &id006 !ruby/object:Gem::Requirement
100
+ name: rspec
101
+ prerelease: false
102
+ requirement: &id006 !ruby/object:Gem::Requirement
101
103
  none: false
102
104
  requirements:
103
105
  - - ~>
@@ -107,12 +109,12 @@ dependencies:
107
109
  - 2
108
110
  - 11
109
111
  version: "2.11"
110
- prerelease: false
111
112
  type: :development
112
- name: rspec
113
- requirement: *id006
113
+ version_requirements: *id006
114
114
  - !ruby/object:Gem::Dependency
115
- version_requirements: &id007 !ruby/object:Gem::Requirement
115
+ name: webmock
116
+ prerelease: false
117
+ requirement: &id007 !ruby/object:Gem::Requirement
116
118
  none: false
117
119
  requirements:
118
120
  - - ~>
@@ -122,12 +124,12 @@ dependencies:
122
124
  - 1
123
125
  - 9
124
126
  version: "1.9"
125
- prerelease: false
126
127
  type: :development
127
- name: webmock
128
- requirement: *id007
128
+ version_requirements: *id007
129
129
  - !ruby/object:Gem::Dependency
130
- version_requirements: &id008 !ruby/object:Gem::Requirement
130
+ name: rr
131
+ prerelease: false
132
+ requirement: &id008 !ruby/object:Gem::Requirement
131
133
  none: false
132
134
  requirements:
133
135
  - - ~>
@@ -137,12 +139,12 @@ dependencies:
137
139
  - 1
138
140
  - 0
139
141
  version: "1.0"
140
- prerelease: false
141
142
  type: :development
142
- name: rr
143
- requirement: *id008
143
+ version_requirements: *id008
144
144
  - !ruby/object:Gem::Dependency
145
- version_requirements: &id009 !ruby/object:Gem::Requirement
145
+ name: gem-release
146
+ prerelease: false
147
+ requirement: &id009 !ruby/object:Gem::Requirement
146
148
  none: false
147
149
  requirements:
148
150
  - - ">="
@@ -151,12 +153,12 @@ dependencies:
151
153
  segments:
152
154
  - 0
153
155
  version: "0"
154
- prerelease: false
155
156
  type: :development
156
- name: gem-release
157
- requirement: *id009
157
+ version_requirements: *id009
158
158
  - !ruby/object:Gem::Dependency
159
- version_requirements: &id010 !ruby/object:Gem::Requirement
159
+ name: timecop
160
+ prerelease: false
161
+ requirement: &id010 !ruby/object:Gem::Requirement
160
162
  none: false
161
163
  requirements:
162
164
  - - ">="
@@ -165,10 +167,8 @@ dependencies:
165
167
  segments:
166
168
  - 0
167
169
  version: "0"
168
- prerelease: false
169
170
  type: :development
170
- name: timecop
171
- requirement: *id010
171
+ version_requirements: *id010
172
172
  description:
173
173
  email:
174
174
  - vcap-dev@googlegroups.com
@@ -270,6 +270,7 @@ files:
270
270
  - spec/cfoundry/v2/app_spec.rb
271
271
  - spec/cfoundry/v2/base_spec.rb
272
272
  - spec/cfoundry/v2/client_spec.rb
273
+ - spec/cfoundry/v2/domain_spec.rb
273
274
  - spec/cfoundry/v2/model_magic_spec.rb
274
275
  - spec/cfoundry/v2/organization_spec.rb
275
276
  - spec/cfoundry/v2/space_spec.rb
@@ -307,6 +308,8 @@ files:
307
308
  - spec/fixtures/fake_cc_created_service_instance.json
308
309
  - spec/fixtures/fake_cc_created_space.json
309
310
  - spec/fixtures/fake_cc_created_user.json
311
+ - spec/fixtures/fake_cc_domain.json
312
+ - spec/fixtures/fake_cc_domain_spaces.json
310
313
  - spec/fixtures/fake_cc_empty_search.json
311
314
  - spec/fixtures/fake_cc_frameworks.json
312
315
  - spec/fixtures/fake_cc_organization.json
@@ -322,6 +325,7 @@ files:
322
325
  - spec/fixtures/fake_cc_service_types.json
323
326
  - spec/fixtures/fake_cc_space.json
324
327
  - spec/fixtures/fake_cc_space_summary.json
328
+ - spec/fixtures/fake_cc_spaces.json
325
329
  - spec/fixtures/fake_cc_stats.json
326
330
  - spec/fixtures/fake_cc_user.json
327
331
  - spec/fixtures/fake_cc_user_organizations.json
@@ -396,6 +400,7 @@ test_files:
396
400
  - spec/cfoundry/v2/app_spec.rb
397
401
  - spec/cfoundry/v2/base_spec.rb
398
402
  - spec/cfoundry/v2/client_spec.rb
403
+ - spec/cfoundry/v2/domain_spec.rb
399
404
  - spec/cfoundry/v2/model_magic_spec.rb
400
405
  - spec/cfoundry/v2/organization_spec.rb
401
406
  - spec/cfoundry/v2/space_spec.rb
@@ -433,6 +438,8 @@ test_files:
433
438
  - spec/fixtures/fake_cc_created_service_instance.json
434
439
  - spec/fixtures/fake_cc_created_space.json
435
440
  - spec/fixtures/fake_cc_created_user.json
441
+ - spec/fixtures/fake_cc_domain.json
442
+ - spec/fixtures/fake_cc_domain_spaces.json
436
443
  - spec/fixtures/fake_cc_empty_search.json
437
444
  - spec/fixtures/fake_cc_frameworks.json
438
445
  - spec/fixtures/fake_cc_organization.json
@@ -448,6 +455,7 @@ test_files:
448
455
  - spec/fixtures/fake_cc_service_types.json
449
456
  - spec/fixtures/fake_cc_space.json
450
457
  - spec/fixtures/fake_cc_space_summary.json
458
+ - spec/fixtures/fake_cc_spaces.json
451
459
  - spec/fixtures/fake_cc_stats.json
452
460
  - spec/fixtures/fake_cc_user.json
453
461
  - spec/fixtures/fake_cc_user_organizations.json