diff --git a/tests/openstack/authenticate_tests.rb b/tests/openstack/authenticate_tests.rb index ed47b6b92..83a5d03a5 100644 --- a/tests/openstack/authenticate_tests.rb +++ b/tests/openstack/authenticate_tests.rb @@ -102,6 +102,26 @@ Shindo.tests('OpenStack | authenticate', ['openstack']) do end end + tests("v2 missing storage service") do + Excon.stub({ :method => 'POST', :path => "/v2.0/tokens" }, + { :status => 200, :body => Fog::JSON.encode(body) }) + + raises(NoMethodError, + "undefined method `join' for \"object-store\":String") do + Fog::OpenStack.authenticate_v2( + :openstack_auth_uri => URI('http://example/v2.0/tokens'), + :openstack_tenant => 'admin', + :openstack_service_type => 'object-store') + end + raises(Fog::Errors::NotFound, + "Could not find service object-store. Have compute, image") do + Fog::OpenStack.authenticate_v2( + :openstack_auth_uri => URI('http://example/v2.0/tokens'), + :openstack_tenant => 'admin', + :openstack_service_type => %w[object-store]) + end + end + tests("v2 auth with two compute services") do body_clone = body.clone body_clone["access"]["serviceCatalog"] <<