def test_it_z0_stop_and_start_instance
$created_instances.each do |instance_id|
get_auth_url "/api/instances/#{instance_id}", {}
stop_url = (last_xml_response/'actions/link[@rel="stop"]').first['href']
stop_url.should_not == nil
post_url stop_url
last_response.status.should == 200
instance = Nokogiri::XML(last_response.body)
test_instance_attributes(instance)
(instance/'state').text.should == 'STOPPED'
get_auth_url "/api/instances/#{instance_id}", {}
start_url = (last_xml_response/'actions/link[@rel="start"]').first['href']
start_url.should_not == nil
post_url start_url
last_response.status.should == 200
instance = Nokogiri::XML(last_response.body)
test_instance_attributes(instance)
(instance/'state').text.should == 'RUNNING'
end
end