Commit graph

29 commits

Author SHA1 Message Date
oleghasjanov
54aefe4a2c update regex 2025-03-10 15:13:09 +02:00
oleghasjanov
f866b549b5 # Improve email validation regex pattern and add comprehensive tests
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.
2025-03-10 14:24:02 +02:00
oleghasjanov
95a6403595 Fix ProcessClientHold tests and implementation
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.
2025-03-06 15:32:39 +02:00
oleghasjanov
29c6c8ff44 Fix ProcessClientHold tests and implementation
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.
2025-03-06 15:18:16 +02:00
oleghasjanov
6d657426e5 remove test 2025-02-03 14:08:50 +02:00
Oleg Hasjanov
f8fcf0e456 added test 2023-08-22 15:36:11 +03:00
Sergei Tsoganov
d3bca1434c Refactored and corrected code for domain force delete 2023-05-17 16:04:40 +03:00
Timo Võhmar
e4740ffceb
Merge pull request #2437 from internetee/2436-fd-process-for-long-term-registrations
outzone rake task for invalid email domains
2022-11-02 15:53:11 +02:00
olegphenomenon
e3a8d9ada7 fixed issue with succesful results 2022-10-26 15:45:38 +03:00
olegphenomenon
37c6239b13 assign the limit of validation records 2022-10-24 15:52:49 +03:00
olegphenomenon
4567e56457 added new tests 2022-09-29 10:14:57 +03:00
olegphenomenon
3d81164b23 remove soft force delete from sample 2022-09-09 13:46:24 +03:00
olegphenomenon
d15119c622 outzone rake task for invalid email domains 2022-09-08 16:05:25 +03:00
Sergei Tsõganov
26cb791586 Fixes after repp-apidoc update 2022-07-12 15:48:43 +03:00
Thiago Youssef
f6df99237f Add tests for force delete email from hold domains 2022-03-08 12:33:50 +02:00
olegphenomenon
b8be4ec928 update test name 2021-12-28 13:37:40 +02:00
olegphenomenon
9268206daf added ability to validate invalid mx email by a and aaaa records 2021-12-28 13:37:40 +02:00
olegphenomenon
1845fd8aa1 added test 2021-12-27 10:26:47 +02:00
Timo Võhmar
22351c9053
Merge pull request #1814 from internetee/add-guard-clause-to-mass-nameserver-change
Bulk NS change: Verify CSV integrity
2021-06-25 14:43:00 +03:00
Oleg Hasjanov
5b276dd729 changed list of email received 2021-05-21 12:36:04 +03:00
Oleg Hasjanov
c52cb21a80 added test, change rescue error handler 2021-05-05 11:49:16 +03:00
Alex Sherman
929ada8fd0 Add sidekiq as a job backend 2021-04-12 17:22:36 +05:00
Alex Sherman
ab248a641e Fix domain expiration mailer email validation 2021-03-23 18:40:59 +05:00
Oleg Hasjanov
c352936a21 test: added new tests 2021-03-04 13:22:45 +02:00
Timo Võhmar
c05864486f
Merge pull request #1768 from internetee/1767-move-domain-cron-to-interactors
Move DomainCron methods to interactor
2020-12-14 15:19:50 +02:00
Alex Sherman
ac3860bbd8 Add test for redemption grace period 2020-12-08 13:16:07 +05:00
Alex Sherman
167b37c61f Add tests for DOmainCrone#expire_period 2020-12-08 13:16:07 +05:00
Alex Sherman
30ddf83ee4 Move interactor to namespace 2020-12-08 13:14:48 +05:00
Alex Sherman
4c7f9f2026 Add interactor tests 2020-12-08 13:14:48 +05:00