Sha256: ecb4df23d89a2a40f2e047b6f9bcaf364c562b688d4ddaff1df5da0862902612
Contents?: true
Size: 1.25 KB
Versions: 3
Compression:
Stored size: 1.25 KB
Contents
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..') require 'tests/drivers/rackspace/common' module RackspaceTest class RealmsTest < Test::Unit::TestCase include Rack::Test::Methods def app Rack::Builder.new { map '/' do use Rack::Static, :urls => ["/stylesheets", "/javascripts"], :root => "public" run Rack::Cascade.new([Deltacloud::API]) end } end def test_01_it_returns_realms get_auth_url '/api;driver=rackspace/realms' (last_xml_response/'realms/realm').length.should == 1 end def test_02_each_realm_has_a_name get_auth_url '/api;driver=rackspace/realms' (last_xml_response/'realms/realm').each do |profile| (profile/'name').text.should_not == nil (profile/'name').text.should_not == '' (profile/'name').text.should == 'United States' end end def test_03_it_returns_single_realm get_auth_url '/api;driver=rackspace/realms/us' (last_xml_response/'realm').first[:id].should == 'us' (last_xml_response/'realm/name').first.text.should == 'United States' (last_xml_response/'realm/state').first.text.should == 'AVAILABLE' (last_xml_response/'realm/limit').first.text.should == '' end end end
Version data entries
3 entries across 3 versions & 1 rubygems