This commit updates the email validation pattern in Truemail configuration to better handle various email format edge cases. The changes include:
Refine email regex pattern in config/initializers/truemail.rb to properly validate:
RFC compliant local parts with allowed special characters
Proper domain name formatting
Prevention of consecutive dots in both local part and domain
Leading and trailing dots in local part
Add comprehensive test cases in test/interactions/email_check_test.rb to verify:
Valid email formats like standard addresses, underscore usage, and dot-atom formats
Invalid email formats including consecutive dots, leading/trailing dots, and invalid characters
These changes ensure our email validation is more RFC-compliant while still being strict enough to catch common errors. The test suite now explicitly validates both positive and negative test cases for email format validation.
This commit addresses several issues with the ProcessClientHold class and its tests:
1. Changed notification text in notify_client_hold method from 'force_delete_set_on_domain'
to 'hold_client_on_domain' to better reflect the actual action being performed.
Added corresponding translation key in locales/en.yml.
2. Fixed the test_send_mail_delivers_email test by using stub method instead of
redefining DomainDeleteMailer.forced, which was causing conflicts with other tests.
This ensures that tests are isolated and don't affect each other.
3. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
to properly stub the force_delete_scheduled? method.
4. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
including notification creation and client hold status setting.
5. Added proper error handling in tests to ensure methods don't raise exceptions.
The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars with
appropriate messages, and sends emails when required.
This commit addresses several issues with the ProcessClientHold class and its tests:
1. Fixed the test_send_mail_delivers_email test by properly mocking the
DomainDeleteMailer.forced method with correct parameter signatures
and adding template_name to the domain.
2. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
to properly stub the force_delete_scheduled? method.
3. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
including notification creation and client hold status setting.
4. Added proper error handling in tests to ensure methods don't raise exceptions
and restore original method implementations after testing.
The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars,
and sends emails when required.