Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 01:06:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 01:06:32 +0300
commit15892d0271ce6e70fce3534ee12f649004ce148d (patch)
tree60af9ae90570e987d366db3b9102d9bea4985387 /spec/models
parentf5897da89ca63facbef54c23cff894f2bbe8e644 (diff)
Add latest changes from gitlab-org/security/gitlab@15-4-stable-ee
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/user_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 04f2c7f9176..3cc34681ad6 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -6866,6 +6866,25 @@ RSpec.describe User do
end
end
+ describe '#webhook_email' do
+ let(:user) { build(:user, public_email: nil) }
+
+ context 'when public email is present' do
+ before do
+ user.public_email = "hello@hello.com"
+ end
+ it 'returns public email' do
+ expect(user.webhook_email).to eq(user.public_email)
+ end
+ end
+
+ context 'when public email is nil' do
+ it 'returns [REDACTED]' do
+ expect(user.webhook_email).to eq(_('[REDACTED]'))
+ end
+ end
+ end
+
describe 'user credit card validation' do
context 'when user is initialized' do
let(:user) { build(:user) }