mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Add tests
This commit is contained in:
parent
cc0a6c229f
commit
9d74cd5673
2 changed files with 21 additions and 2 deletions
|
@ -19,6 +19,19 @@ class NotificationTest < ActiveSupport::TestCase
|
|||
assert @notification.invalid?
|
||||
end
|
||||
|
||||
def test_unread_by_default
|
||||
notification = Notification.new(registrar: registrars(:bestnames), text: 'test')
|
||||
assert_not notification.read?
|
||||
|
||||
notification.save!
|
||||
assert_not notification.read?
|
||||
end
|
||||
|
||||
def test_honor_given_read_state
|
||||
notification = Notification.new(read: true)
|
||||
assert notification.read?
|
||||
end
|
||||
|
||||
def test_mark_as_read
|
||||
@notification.mark_as_read
|
||||
@notification.reload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue