Skip to content
Snippets Groups Projects
Commit 8d6685ad authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Automatic merge of gitlab-org/gitlab master

parents a8d78a26 6352bc50
No related branches found
No related tags found
2 merge requests!181325Fix ambiguous `created_at` in project.rb,!179611Draft: Rebase CR approach for zoekt assignments
......@@ -39,7 +39,8 @@ def show_pipl_compliance_alert?
::Gitlab::Saas.feature_available?(:pipl_compliance) &&
!user_dismissed?(PIPL_COMPLIANCE_ALERT) &&
::ComplianceManagement::Pipl.user_subject_to_pipl?(current_user) &&
::Feature.enabled?(:enforce_pipl_compliance, current_user)
::Feature.enabled?(:enforce_pipl_compliance, current_user) &&
current_user.pipl_user.initial_email_sent_at.present?
end
def show_new_user_signups_cap_reached?
......
......@@ -78,6 +78,8 @@ def notification_sent!
end
def remaining_pipl_access_days
return if initial_email_sent_at.blank?
(pipl_access_end_date - Date.current).to_i
end
......
......@@ -202,6 +202,16 @@
expect(show_pipl_compliance_alert?).to be(false)
end
end
context 'when the email has not been sent yet' do
before do
pipl_user.reset_notification!
end
it 'does not show the alert' do
expect(show_pipl_compliance_alert?).to be(false)
end
end
end
end
......
......@@ -423,5 +423,13 @@
it 'calculate the remaining pipl access days', :freeze_time do
expect(remaining_pipl_access_days).to be(50)
end
context 'when email is not sent yet' do
let(:pipl_user) { create(:pipl_user, initial_email_sent_at: nil) }
it 'returns null' do
expect(remaining_pipl_access_days).to be_nil
end
end
end
end
......@@ -9216,7 +9216,7 @@ def owner_class_attribute_default; end
it 'returns the expiration time when it exists' do
allow(retrieve_service).to receive(:execute).and_return(pin_data)
expect(user_with_pin.support_pin_expires_at).to be_within(1.second).of(pin_data[:expires_at])
expect(user_with_pin.support_pin_expires_at).to be_within(2.seconds).of(pin_data[:expires_at])
end
it 'returns nil when no expiration time exists' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment