1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/spec/slicehost/requests/get_slices_spec.rb
2010-02-04 00:27:14 -08:00

34 lines
1 KiB
Ruby

require File.dirname(__FILE__) + '/../../spec_helper'
describe 'Slicehost.get_slices' do
describe 'success' do
before(:each) do
# flavor_id 1: 256 ram, image_id 3: Gentoo 2008.0
@slice_id = Slicehost[:slices].create_slice(1, 3, 'fog_create_slice').body['id']
end
after(:each) do
eventually(128) do
Slicehost[:slices].delete_slice(@slice_id)
end
end
it "should return proper attributes" do
actual = Slicehost[:slices].get_slices.body
actual['slices'].should be_an(Array)
slice = actual['slices'].first
slice['addresses'].should be_a(Array)
# slice['backup-id'].should be_an(Integer)
slice['bw-in'].should be_a(Float)
slice['bw-out'].should be_a(Float)
slice['flavor-id'].should be_an(Integer)
slice['id'].should be_an(Integer)
slice['image-id'].should be_an(Integer)
slice['name'].should be_an(String)
slice['progress'].should be_an(Integer)
slice['status'].should be_an(String)
end
end
end