Skip to content

Commit d9d208c

Browse files
committed
Minor Alignment changes, leveraging subclass for collection spec.
1 parent 946c271 commit d9d208c

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

spec/manageiq/api/collection_spec.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
describe ManageIQ::API::Client::Collection do
2-
let(:api_url) { "http://localhost:3000/api" }
3-
let(:groups_url) { "#{api_url}/groups" }
4-
let(:vms_url) { "#{api_url}/vms" }
5-
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
6-
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
2+
let(:api_url) { "http://localhost:3000/api" }
3+
let(:groups_url) { "#{api_url}/groups" }
4+
let(:vms_url) { "#{api_url}/vms" }
5+
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
6+
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
77

88
let(:entrypoint_response) { api_file_fixture("responses/entrypoint.json") }
99
let(:get_vms_response) { api_file_fixture("responses/get_vms.json") }
@@ -25,8 +25,7 @@
2525
expect(miq.collections.collect(&:name)).to match_array(collection_names)
2626

2727
miq.collections.each do |collection|
28-
klass = "#{described_class}::#{collection.name.camelize}".constantize
29-
expect(collection).to be_a(klass)
28+
expect(collection).to be_a(described_class.subclass(collection.name))
3029
end
3130
end
3231
end

spec/manageiq/api/resource_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
describe ManageIQ::API::Client::Resource do
2-
let(:api_url) { "http://localhost:3000/api" }
3-
let(:vms_url) { "#{api_url}/vms" }
4-
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
5-
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
2+
let(:api_url) { "http://localhost:3000/api" }
3+
let(:vms_url) { "#{api_url}/vms" }
4+
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
5+
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
66

77
let(:entrypoint_response) { api_file_fixture("responses/entrypoint.json") }
88
let(:get_test1_vms_response) { api_file_fixture("responses/get_test1_vms.json") }

spec/manageiq/api/subresource_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
describe ManageIQ::API::Client::Subresource do
2-
let(:api_url) { "http://localhost:3000/api" }
3-
let(:vms_url) { "#{api_url}/vms" }
4-
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
5-
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
2+
let(:api_url) { "http://localhost:3000/api" }
3+
let(:vms_url) { "#{api_url}/vms" }
4+
let(:vms_expand_url) { "#{vms_url}?expand=resources" }
5+
let(:entrypoint_request_url) { "#{api_url}?attributes=authorization" }
66

77
let(:entrypoint_response) { api_file_fixture("responses/entrypoint.json") }
88
let(:options_vms_response) { api_file_fixture("responses/options_vms.json") }

0 commit comments

Comments
 (0)