1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/compute/requests/brightbox/account_tests.rb
Paul Thornthwaite 50a31e00c7 [compute|brightbox] DRY up request method
* New method signature rather than thin wrapper over Excon
* JSON Content-Type header added later not per request
* options are no longer empty and always sent
2011-08-17 15:54:16 +01:00

40 lines
1.1 KiB
Ruby

Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
tests('success') do
tests("#get_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
pending if Fog.mocking?
Fog::Compute[:brightbox].get_account
end
unless Fog.mocking?
original_name = Fog::Compute[:brightbox].get_account["name"]
update_args = {:name => "New name from Fog test"}
end
tests("#update_account(#{update_args.inspect})").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
pending if Fog.mocking?
Fog::Compute[:brightbox].update_account(update_args)
end
unless Fog.mocking?
Fog::Compute[:brightbox].update_account(:name => original_name)
end
tests("#reset_ftp_password_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
pending if Fog.mocking?
Fog::Compute[:brightbox].reset_ftp_password_account
end
end
tests('failure') do
tests("#update_account").raises(ArgumentError) do
pending if Fog.mocking?
Fog::Compute[:brightbox].update_account
end
end
end