From 3b760d683864db8564c1aea466e2ae9f9f151756 Mon Sep 17 00:00:00 2001 From: Kyle Rames Date: Thu, 20 Jun 2013 16:23:19 -0500 Subject: [PATCH] [rackspace|identity] fixing broken identity tests --- lib/fog/rackspace/models/identity/users.rb | 4 ++-- tests/rackspace/requests/identity/user_tests.rb | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/fog/rackspace/models/identity/users.rb b/lib/fog/rackspace/models/identity/users.rb index 526629f37..646dadf31 100644 --- a/lib/fog/rackspace/models/identity/users.rb +++ b/lib/fog/rackspace/models/identity/users.rb @@ -18,7 +18,7 @@ module Fog new(data) rescue Excon::Errors::NotFound nil - rescue Excon::Errors::NotAuthorized + rescue Excon::Errors::Unauthorized nil end @@ -27,7 +27,7 @@ module Fog new(data) rescue Excon::Errors::NotFound nil - rescue Excon::Errors::NotAuthorized + rescue Excon::Errors::Unauthorized nil end end diff --git a/tests/rackspace/requests/identity/user_tests.rb b/tests/rackspace/requests/identity/user_tests.rb index 62803beb0..20026474b 100644 --- a/tests/rackspace/requests/identity/user_tests.rb +++ b/tests/rackspace/requests/identity/user_tests.rb @@ -41,7 +41,7 @@ Shindo.tests('Fog::Rackspace::Identity | users', ['rackspace']) do service = Fog::Rackspace::Identity.new id = nil - username = 'foguser' + username = "fog#{Time.now.to_i.to_s}" email = 'fog_user@example.com' enabled = true password = 'Fog_password1' @@ -57,6 +57,9 @@ Shindo.tests('Fog::Rackspace::Identity | users', ['rackspace']) do service.delete_user(id) end + # there appears to be a werid caching issue. It's just easier to create a new username and continue on + username = "fog#{Time.now.to_i.to_s}" + tests('#create_user with password').succeeds do data = service.create_user(username, email, enabled, :password => password ).body id = data['user']['id']