Sha256: 5b87b13e8ba97f04aaabd4601c12f3568a2fd1975777a0231af1045a00dcc83d
Contents?: true
Size: 1.37 KB
Versions: 4
Compression:
Stored size: 1.37 KB
Contents
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..') require 'tests/common' module RackspaceTest class ApiTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_01_it_returns_entry_points get_auth_url '/api;driver=rackspace/?force_auth=1' (last_xml_response/'/api').first[:driver].should == 'rackspace' (last_xml_response/'/api/link').length.should > 0 end def test_02_it_has_rackspace_features get_url '/api;driver=rackspace' features = (last_xml_response/'/api/link[@rel="instances"]/feature').collect { |f| f[:name] } features.include?('user_name').should == true features.include?('authentication_password').should == true features.include?('user_files').should == true features.length.should == 3 end def test_03_it_has_rackspace_collections get_url '/api;driver=rackspace' collections = (last_xml_response/'/api/link').collect { |f| f[:rel] } collections.include?('instance_states').should == true collections.include?('instances').should == true collections.include?('images').should == true collections.include?('buckets').should == true collections.include?('realms').should == true collections.include?('hardware_profiles').should == true collections.length.should == 7 end end end
Version data entries
4 entries across 4 versions & 1 rubygems