1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/vcloud_director/models/compute/organizations_tests.rb
Nick Osborn 1f9837c865 [vcloud_director] Start mocking requests.
- also adds get_current_session request
2013-09-26 11:31:19 +01:00

22 lines
824 B
Ruby

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
VCR.use_cassette(File.basename(__FILE__)) do
Shindo.tests("Compute::VcloudDirector | organizations", ['vclouddirector', 'all']) do
organizations = vcloud_director.organizations
tests("#There is at least one organization").returns(true) { organizations.size >= 1 }
org = organizations.first
tests("Compute::VcloudDirector | organization") do
tests("#name").returns(String) { org.name.class }
tests("#type").returns("application/vnd.vmware.vcloud.org+xml") { org.type }
end
tests("Compute::VcloudDirector | organization", ['get']) do
tests("#get_by_name").returns(org.name) { organizations.get_by_name(org.name).name }
tests("#get").returns(org.id) { organizations.get(org.id).id }
end
end
end