2011-02-17 13:44:46 -05:00
|
|
|
require 'ecloud/spec_helper'
|
2010-06-17 19:58:09 -04:00
|
|
|
|
|
|
|
if Fog.mocking?
|
2011-02-17 13:44:46 -05:00
|
|
|
describe "Fog::Ecloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
2010-06-17 19:58:09 -04:00
|
|
|
subject { @vcloud }
|
|
|
|
|
2011-02-15 16:47:14 -05:00
|
|
|
it { should respond_to(:get_network_ip) }
|
2010-06-17 19:58:09 -04:00
|
|
|
|
|
|
|
describe "#get_network_ip" do
|
|
|
|
context "with a valid ip_uri" do
|
|
|
|
before do
|
2010-10-17 19:06:44 -04:00
|
|
|
@ip = @vcloud.get_network_ip(@mock_network_ip.href)
|
2010-06-17 19:58:09 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
subject { @ip }
|
|
|
|
|
|
|
|
it_should_behave_like "all responses"
|
2011-02-15 16:47:14 -05:00
|
|
|
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.ip+xml") }
|
2010-06-17 19:58:09 -04:00
|
|
|
|
|
|
|
describe "#body" do
|
|
|
|
subject { @ip.body }
|
|
|
|
|
2010-10-17 19:06:44 -04:00
|
|
|
its(:Name) { should == @mock_network_ip.name }
|
|
|
|
its(:Href) { should == @mock_network_ip.href }
|
|
|
|
its(:Id) { should == @mock_network_ip.object_id.to_s }
|
2010-11-05 09:45:48 -04:00
|
|
|
its(:RnatAddress) { should == @mock_network_ip.rnat }
|
|
|
|
its(:Status) { should == @mock_network_ip.status }
|
2010-06-17 19:58:09 -04:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with an ip_uri that doesn't exist" do
|
|
|
|
subject { lambda { @vcloud.get_network_ip('https://www.fakey.c/piv89') } }
|
|
|
|
|
|
|
|
it_should_behave_like "a request for a resource that doesn't exist"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
end
|