mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Introduce negative predicate
This commit is contained in:
parent
9d74cd5673
commit
a1fb0e2e61
3 changed files with 7 additions and 3 deletions
|
@ -13,6 +13,10 @@ class Notification < ActiveRecord::Base
|
||||||
save
|
save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unread?
|
||||||
|
!read?
|
||||||
|
end
|
||||||
|
|
||||||
# Needed for EPP log
|
# Needed for EPP log
|
||||||
def name
|
def name
|
||||||
"-"
|
"-"
|
||||||
|
|
|
@ -82,7 +82,7 @@ class EppPollTest < ApplicationIntegrationTest
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
notification.reload
|
notification.reload
|
||||||
|
|
||||||
assert_not notification.read?
|
assert notification.unread?
|
||||||
assert_equal 2303.to_s, response_xml.at_css('result')[:code]
|
assert_equal 2303.to_s, response_xml.at_css('result')[:code]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,10 @@ class NotificationTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def test_unread_by_default
|
def test_unread_by_default
|
||||||
notification = Notification.new(registrar: registrars(:bestnames), text: 'test')
|
notification = Notification.new(registrar: registrars(:bestnames), text: 'test')
|
||||||
assert_not notification.read?
|
assert notification.unread?
|
||||||
|
|
||||||
notification.save!
|
notification.save!
|
||||||
assert_not notification.read?
|
assert notification.unread?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_honor_given_read_state
|
def test_honor_given_read_state
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue