mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Bounces: Fix tests
This commit is contained in:
parent
98674ab381
commit
3222a8b9a7
4 changed files with 58 additions and 86 deletions
|
@ -1,11 +1,8 @@
|
|||
class BouncedMailAddress < ApplicationRecord
|
||||
validates :email, :message_id, :bounce_type, :bounce_subtype, :action, :status, presence: true
|
||||
before_validation :assign_bounce_reason
|
||||
|
||||
def assign_bounce_reason
|
||||
return self.bounce_reason = nil unless recipient_json
|
||||
|
||||
self.bounce_reason = "#{action} (#{status} #{diagnostic})"
|
||||
def bounce_reason
|
||||
"#{action} (#{status} #{diagnostic})"
|
||||
end
|
||||
|
||||
def self.record(json)
|
||||
|
@ -17,7 +14,7 @@ class BouncedMailAddress < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def params_from_json(json, bounced_record)
|
||||
def self.params_from_json(json, bounced_record)
|
||||
{
|
||||
email: bounced_record['emailAddress'],
|
||||
message_id: json['mail']['messageId'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue