internetee-registry/test/models/notification_test.rb
2018-08-24 10:29:09 +03:00

27 lines
No EOL
524 B
Ruby

require 'test_helper'
class NotificationTest < ActiveSupport::TestCase
setup do
@notification = notifications(:greeting)
end
def test_valid
assert @notification.valid?
end
def test_invalid_without_text
@notification.text = ''
assert @notification.invalid?
end
def test_invalid_without_registrar
@notification.registrar = nil
assert @notification.invalid?
end
def test_mark_as_read
@notification.mark_as_read
@notification.reload
assert @notification.read?
end
end