spec/resource_spec.rb in vmware-vra-1.7.0 vs spec/resource_spec.rb in vmware-vra-2.0.0.pre1
- old
+ new
@@ -303,9 +303,13 @@
end
end
describe '#ip_addresses' do
it 'returns the correct IP addresses' do
+ stub_request(:post, "https://vra.corp.local/identity/api/tokens").
+ with(:body => "{\"username\":\"user@corp.local\",\"password\":\"password\",\"tenant\":\"tenant\"}",
+ :headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json'}).
+ to_return(:status => 200, :body => "", :headers => {})
expect(resource.ip_addresses).to eq [ '192.168.110.200', '192.168.220.200' ]
end
it 'returns nil if there are no network interfaces' do
allow(resource).to receive(:network_interfaces).and_return nil