mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
b5ff3eaeb1
When passing an object that responds to `identity` which is all of our resources, we can pass the resource's identifier in to the API call to make it easier to use without maintaining a list of classes. Server's need to use the interface for the destination so they override a new `mapping_identity` method which is picked up first. Anything else (such as a String identifier) is passed directly to the API request as before.
19 lines
503 B
Ruby
19 lines
503 B
Ruby
Shindo.tests("Fog::Compute[:brightbox] | Server model", ["brightbox"]) do
|
|
pending if Fog.mocking?
|
|
|
|
tests("success") do
|
|
@server = Brightbox::Compute::TestSupport.get_test_server
|
|
server_id = @server.id
|
|
|
|
tests("#dns_name") do
|
|
returns("public.#{@server.fqdn}") { @server.dns_name }
|
|
end
|
|
|
|
tests("#mapping_identity") do
|
|
first_interface_id = @server.interfaces.first["id"]
|
|
returns(first_interface_id) { @server.mapping_identity }
|
|
end
|
|
|
|
@server.destroy
|
|
end
|
|
end
|