diff options
author | Rémy Coutable <remy@rymai.me> | 2019-01-21 17:24:56 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-01-23 13:17:05 +0100 |
commit | cbc3d1f9115d58ee590d84dac52f4b1ddd9dd7a3 (patch) | |
tree | e9ebbb2811609c00a5a657c64b8e123c4892aae7 /qa/qa/resource | |
parent | cae2330b54eb572edbc84bfd6bacb5408534a61b (diff) | |
download | gitlab-ce-cbc3d1f9115d58ee590d84dac52f4b1ddd9dd7a3.tar.gz |
[QA] Use public_email instead of email since it's available
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/qa/resource')
-rw-r--r-- | qa/qa/resource/user.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/qa/qa/resource/user.rb b/qa/qa/resource/user.rb index b9580d81171..6c5e91b6488 100644 --- a/qa/qa/resource/user.rb +++ b/qa/qa/resource/user.rb @@ -17,11 +17,11 @@ module QA end def username - @username ||= "qa-user-#{unique_id}" + @username || "qa-user-#{unique_id}" end def password - @password ||= 'password' + @password || 'password' end def name @@ -29,7 +29,15 @@ module QA end def email - @email ||= api_resource&.dig(:email) || "#{username}@example.com" + @email ||= "#{username}@example.com" + end + + def public_email + @public_email ||= begin + api_public_email = api_resource&.dig(:public_email) + + api_public_email && api_public_email != '' ? api_public_email : Runtime::User.default_email + end end def credentials_given? |