1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[Brightbox] Fixes Account#reset_ftp_password

Tests that Account#reset_ftp_password is working (had an issue
previously) and now merges the results in making the password value
available on the model whilst it exists.
This commit is contained in:
Paul Thornthwaite 2012-11-20 11:28:14 +00:00
parent 0cb518a3d2
commit 4b79b6ba04
2 changed files with 24 additions and 3 deletions

View file

@ -32,7 +32,7 @@ module Fog
attribute :load_balancers_used
attribute :library_ftp_host
attribute :library_ftp_user
# This is always returned as null/nil unless performing a reset_ftp_password request
# This is always returned as nil unless after a call to reset_ftp_password
attribute :library_ftp_password
# Boolean flags
@ -51,13 +51,19 @@ module Fog
attribute :users
attribute :zones
# Resets the account's image library FTP password returning the new value
#
# @return [String] Newly issue FTP password
#
def reset_ftp_password
requires :identity
connection.reset_ftp_password_account["library_ftp_password"]
data = connection.reset_ftp_password_account(identity)
merge_attributes(data)
library_ftp_password
end
end
end
end
end
end

View file

@ -0,0 +1,15 @@
Shindo.tests("Fog::Compute[:brightbox] | Account model", ["brightbox"]) do
@account = Fog::Compute[:brightbox].account
tests("success") do
tests("#reset_ftp_password") do
pending if Fog.mocking?
test("original ftp password is blanked") { @account.library_ftp_password.nil? }
@new_password = @account.reset_ftp_password
test("new ftp password was not nil") { !@new_password.nil? }
test("new ftp password is set") { @account.library_ftp_password == @new_password }
end
end
end