Rename notifications.body to text

This commit is contained in:
Artur Beljajev 2018-08-23 21:26:33 +03:00
parent 8765baf319
commit dfff6f6d12
16 changed files with 30 additions and 22 deletions

View file

@ -1,15 +1,15 @@
greeting:
body: Welcome!
text: Welcome!
queued: true
registrar: bestnames
domain_deleted:
body: Your domain has been deleted
text: Your domain has been deleted
queued: true
registrar: bestnames
created_at: <%= Time.zone.parse('2010-07-05').to_s(:db) %>
farewell:
body: Good bye!
text: Good bye!
queued: true
registrar: goodnames

View file

@ -23,7 +23,7 @@ class DomainDeleteConfirmJobTest < ActiveSupport::TestCase
last_registrar_notification = @domain.registrar.notifications.last
assert_equal(last_registrar_notification.attached_obj_id, @domain.id)
assert_equal(last_registrar_notification.body, 'Registrant rejected domain deletion: shop.test')
assert_equal(last_registrar_notification.text, 'Registrant rejected domain deletion: shop.test')
end
def test_accepted_registrant_verification_notifies_registrar
@ -31,6 +31,6 @@ class DomainDeleteConfirmJobTest < ActiveSupport::TestCase
last_registrar_notification = @domain.registrar.notifications.last
assert_equal(last_registrar_notification.attached_obj_id, @domain.id)
assert_equal(last_registrar_notification.body, 'Registrant confirmed domain deletion: shop.test')
assert_equal(last_registrar_notification.text, 'Registrant confirmed domain deletion: shop.test')
end
end

View file

@ -23,7 +23,7 @@ class DomainUpdateConfirmJobTest < ActiveSupport::TestCase
last_registrar_notification = @domain.registrar.notifications.last
assert_equal(last_registrar_notification.attached_obj_id, @domain.id)
assert_equal(last_registrar_notification.body, 'Registrant rejected domain update: shop.test')
assert_equal(last_registrar_notification.text, 'Registrant rejected domain update: shop.test')
end
def test_accepted_registrant_verification_notifies_registrar
@ -31,6 +31,6 @@ class DomainUpdateConfirmJobTest < ActiveSupport::TestCase
last_registrar_notification = @domain.registrar.notifications.last
assert_equal(last_registrar_notification.attached_obj_id, @domain.id)
assert_equal(last_registrar_notification.body, 'Registrant confirmed domain update: shop.test')
assert_equal(last_registrar_notification.text, 'Registrant confirmed domain update: shop.test')
end
end

View file

@ -18,14 +18,14 @@ class DomainTransferTest < ActiveSupport::TestCase
@domain_transfer.approve
end
body = 'Transfer of domain shop.test has been approved.' \
text = 'Transfer of domain shop.test has been approved.' \
' It was associated with registrant john-001' \
' and contacts acme-ltd-001, jane-001, william-001.'
id = @domain_transfer.id
class_name = @domain_transfer.class.name
notification = old_registrar.notifications.last
assert_equal body, notification.body
assert_equal text, notification.text
assert_equal id, notification.attached_obj_id
assert_equal class_name, notification.attached_obj_type
end

View file

@ -9,8 +9,8 @@ class NotificationTest < ActiveSupport::TestCase
assert @notification.valid?
end
def test_invalid_without_body
@notification.body = nil
def test_invalid_without_text
@notification.text = ''
assert @notification.invalid?
end