1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/brightbox/requests/compute/user_tests.rb

37 lines
1,008 B
Ruby
Raw Normal View History

Shindo.tests('Fog::Compute[:brightbox] | user requests', ['brightbox']) do
tests('success') do
2011-09-29 05:15:03 -04:00
tests("#list_users") do
pending if Fog.mocking?
2011-09-29 05:15:03 -04:00
result = Fog::Compute[:brightbox].list_users
@user_id = result.first["id"]
formats(Brightbox::Compute::Formats::Collection::USERS) { result }
end
2011-09-29 05:15:03 -04:00
tests("#get_user('#{@user_id}')") do
pending if Fog.mocking?
2011-09-29 05:15:03 -04:00
result = Fog::Compute[:brightbox].get_user(@user_id)
formats(Brightbox::Compute::Formats::Full::USER) { result }
end
2011-09-29 05:15:03 -04:00
update_options = { :name => "Example User" }
tests("#update_user('#{@user_id}', #{update_options.inspect})") do
pending if Fog.mocking?
2011-09-29 05:15:03 -04:00
result = Fog::Compute[:brightbox].update_user(@user_id, update_options)
formats(Brightbox::Compute::Formats::Full::USER) { result }
end
end
tests('failure') do
tests("#update_user").raises(ArgumentError) do
pending if Fog.mocking?
Fog::Compute[:brightbox].update_user
end
end
end