1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/digitalocean/models/compute/ssh_keys_tests.rb

33 lines
910 B
Ruby
Raw Normal View History

Shindo.tests('Fog::Compute[:digitalocean] | ssh_keys collection', ['digitalocean']) do
service = Fog::Compute[:digitalocean]
tests('The ssh_keys collection') do
key = service.ssh_keys.create :name => 'fookey',
:ssh_pub_key => 'fookey'
[:all, :get].each do |method|
test("should respond to #{method}") do
service.ssh_keys.respond_to? method
end
end
tests('should have Fog::Compute::DigitalOcean::SshKey inside') do
service.ssh_keys.each do |s|
test { s.kind_of? Fog::Compute::DigitalOcean::SshKey }
end
end
tests('should be able to get a model') do
test('by instance id') do
2013-07-21 14:09:53 -04:00
retrieved_key = service.ssh_keys.get(key.id)
test { retrieved_key.kind_of? Fog::Compute::DigitalOcean::SshKey }
test { retrieved_key.name == key.name }
end
end
key.destroy
end
end