1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/openstack/models/identity/role_tests.rb
Nelvin Driz 4d33ccb7a7 [openstack|compute] General Cleanup and Update
- Focus on adding additional vm actions support
- New request types are not fully tested
2012-04-30 10:34:59 +08:00

27 lines
831 B
Ruby

Shindo.tests("Fog::Identity[:openstack] | role", ['openstack']) do
@instance = Fog::Identity[:openstack].roles.new({:name => 'Role Name', :user_id => 1, :role_id => 1})
@tenant = Fog::Identity[:openstack].tenants.create(:name => 'test_user')
@user = Fog::Identity[:openstack].users.create(:name => 'test_user', :tenant_id => @tenant.id, :password => 'spoof')
tests('success') do
tests('#save').returns(true) do
@instance.save
end
tests('#add_to_user(@user.id, @tenant.id)').returns(true) do
@instance.add_to_user(@user.id, @tenant.id)
end
tests('#remove_to_user(@user.id, @tenant.id)').returns(true) do
@instance.remove_to_user(@user.id, @tenant.id)
end
tests('#destroy').returns(true) do
@instance.destroy
end
end
@user.destroy
@tenant.destroy
end