mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Rename Message to Notification
This commit is contained in:
parent
5ba2170324
commit
8765baf319
32 changed files with 243 additions and 229 deletions
|
@ -14,7 +14,7 @@ class DomainTransferTest < ActiveSupport::TestCase
|
|||
def test_notifies_old_registrar_on_approval
|
||||
old_registrar = @domain_transfer.old_registrar
|
||||
|
||||
assert_difference -> { old_registrar.messages.count } do
|
||||
assert_difference -> { old_registrar.notifications.count } do
|
||||
@domain_transfer.approve
|
||||
end
|
||||
|
||||
|
@ -24,9 +24,9 @@ class DomainTransferTest < ActiveSupport::TestCase
|
|||
id = @domain_transfer.id
|
||||
class_name = @domain_transfer.class.name
|
||||
|
||||
message = old_registrar.messages.last
|
||||
assert_equal body, message.body
|
||||
assert_equal id, message.attached_obj_id
|
||||
assert_equal class_name, message.attached_obj_type
|
||||
notification = old_registrar.notifications.last
|
||||
assert_equal body, notification.body
|
||||
assert_equal id, notification.attached_obj_id
|
||||
assert_equal class_name, notification.attached_obj_type
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
require 'test_helper'
|
||||
|
||||
class MessageTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@message = messages(:greeting)
|
||||
end
|
||||
|
||||
def test_valid
|
||||
assert @message.valid?
|
||||
end
|
||||
|
||||
def test_invalid_without_body
|
||||
@message.body = nil
|
||||
assert @message.invalid?
|
||||
end
|
||||
|
||||
def test_invalid_without_registrar
|
||||
@message.registrar = nil
|
||||
assert @message.invalid?
|
||||
end
|
||||
|
||||
def test_dequeue
|
||||
@message.dequeue
|
||||
@message.reload
|
||||
assert_not @message.queued?
|
||||
end
|
||||
end
|
27
test/models/notification_test.rb
Normal file
27
test/models/notification_test.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require 'test_helper'
|
||||
|
||||
class NotificationTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@notification = notifications(:greeting)
|
||||
end
|
||||
|
||||
def test_valid
|
||||
assert @notification.valid?
|
||||
end
|
||||
|
||||
def test_invalid_without_body
|
||||
@notification.body = nil
|
||||
assert @notification.invalid?
|
||||
end
|
||||
|
||||
def test_invalid_without_registrar
|
||||
@notification.registrar = nil
|
||||
assert @notification.invalid?
|
||||
end
|
||||
|
||||
def test_dequeue
|
||||
@notification.dequeue
|
||||
@notification.reload
|
||||
assert_not @notification.queued?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue