diff --git a/app/models/notification.rb b/app/models/notification.rb index c8b46c17e..b0b373978 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -13,6 +13,10 @@ class Notification < ActiveRecord::Base save end + def unread? + !read? + end + # Needed for EPP log def name "-" diff --git a/test/integration/epp/poll_test.rb b/test/integration/epp/poll_test.rb index 30f7a2891..e04874ca8 100644 --- a/test/integration/epp/poll_test.rb +++ b/test/integration/epp/poll_test.rb @@ -82,7 +82,7 @@ class EppPollTest < ApplicationIntegrationTest response_xml = Nokogiri::XML(response.body) notification.reload - assert_not notification.read? + assert notification.unread? assert_equal 2303.to_s, response_xml.at_css('result')[:code] end diff --git a/test/models/notification_test.rb b/test/models/notification_test.rb index 96379d77f..e6783efcf 100644 --- a/test/models/notification_test.rb +++ b/test/models/notification_test.rb @@ -21,10 +21,10 @@ class NotificationTest < ActiveSupport::TestCase def test_unread_by_default notification = Notification.new(registrar: registrars(:bestnames), text: 'test') - assert_not notification.read? + assert notification.unread? notification.save! - assert_not notification.read? + assert notification.unread? end def test_honor_given_read_state