From 6d2b702594632f851723b9366e1603604466d5a5 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 16 Jan 2025 16:01:29 -0600 Subject: [PATCH] Add and --- CHANGELOG.md | 5 ++ Gemfile.lock | 66 +++++++++++++----------- app/models/concerns/noticed/readable.rb | 24 ++++++--- gemfiles/rails_6_1.gemfile.lock | 16 +++--- gemfiles/rails_7.gemfile.lock | 16 +++--- gemfiles/rails_7_1.gemfile.lock | 18 +++---- gemfiles/rails_7_2.gemfile.lock | 18 +++---- gemfiles/rails_8_0.gemfile.lock | 18 +++---- gemfiles/rails_main.gemfile.lock | 20 +++---- lib/noticed/version.rb | 2 +- test/models/noticed/notification_test.rb | 18 +++++++ 11 files changed, 128 insertions(+), 93 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 646ee758..b4a0b2ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ### Unreleased +### 2.6.0 + +* Add `mark_as_read_and_seen` and `mark_as_unread_and_unseen` class methods to `Noticed::Notification` +* Add support for extra kwargs to `mark_as` class methods on `Noticed::Notification` + ### 2.5.1 * Slack delivery methods now verify the `{ok: true/false}` response to catch errors correctly #515 diff --git a/Gemfile.lock b/Gemfile.lock index 29e9f84e..dffe1ea4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -90,17 +90,17 @@ GEM ast (2.4.2) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) crack (1.0.0) bigdecimal rexml crass (1.0.6) date (3.4.1) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) faraday (2.12.2) faraday-net_http (>= 2.0, < 3.5) json @@ -112,7 +112,7 @@ GEM google-cloud-env (2.2.1) faraday (>= 1.0, < 3.a) google-logging-utils (0.1.0) - googleauth (1.12.0) + googleauth (1.12.2) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.2) google-logging-utils (~> 0.1) @@ -126,16 +126,16 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.8.0) - irb (1.14.2) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.9.0) - jwt (2.9.3) + json (2.9.1) + jwt (2.10.1) base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.3) - loofah (2.23.1) + logger (1.6.5) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -145,14 +145,13 @@ GEM net-smtp marcel (1.0.4) mini_mime (1.1.5) - mini_portile2 (2.8.8) minitest (5.25.4) multi_json (1.15.0) net-http (0.6.0) uri net-http2 (0.18.5) http-2 (~> 0.11) - net-imap (0.5.2) + net-imap (0.5.5) date net-protocol net-pop (0.1.2) @@ -160,26 +159,29 @@ GEM net-protocol (0.2.2) timeout net-smtp (0.5.0) - net-protocol nio4r (2.7.4) - nokogiri (1.17.2) - mini_portile2 (~> 2.8.2) + nokogiri (1.18.1-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.1-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.1-x86_64-linux-gnu) racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) - psych (5.2.1) + psych (5.2.2) date stringio public_suffix (6.0.1) racc (1.8.1) rack (3.1.8) - rack-session (2.0.0) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) @@ -214,13 +216,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.9.1) + rdoc (6.11.0) psych (>= 4.0.0) - regexp_parser (2.9.3) + regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -232,7 +234,7 @@ GEM unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.37.0) parser (>= 3.3.1.0) - rubocop-performance (1.23.0) + rubocop-performance (1.23.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) @@ -242,12 +244,13 @@ GEM faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - sqlite3 (2.4.1) - mini_portile2 (~> 2.8.0) - standard (1.43.0) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86_64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -261,7 +264,7 @@ GEM timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.2) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) @@ -270,7 +273,8 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket-driver (0.7.6) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) zeitwerk (2.7.1) @@ -294,4 +298,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.6.2 + 2.6.3 diff --git a/app/models/concerns/noticed/readable.rb b/app/models/concerns/noticed/readable.rb index c31c0f8c..00acc77f 100644 --- a/app/models/concerns/noticed/readable.rb +++ b/app/models/concerns/noticed/readable.rb @@ -10,20 +10,28 @@ module Readable end class_methods do - def mark_as_read - update_all(read_at: Time.current, updated_at: Time.current) + def mark_as_read_and_seen(**kwargs) + update_all(**kwargs.with_defaults(read_at: Time.current, seen_at: Time.current, updated_at: Time.current)) end - def mark_as_unread - update_all(read_at: nil, updated_at: Time.current) + def mark_as_unread_and_unseen(**kwargs) + update_all(**kwargs.with_defaults(read_at: nil, seen_at: nil, updated_at: Time.current)) end - def mark_as_seen - update_all(seen_at: Time.current, updated_at: Time.current) + def mark_as_read(**kwargs) + update_all(**kwargs.with_defaults(read_at: Time.current, updated_at: Time.current)) end - def mark_as_unseen - update_all(seen_at: nil, updated_at: Time.current) + def mark_as_unread(**kwargs) + update_all(**kwargs.with_defaults(read_at: nil, updated_at: Time.current)) + end + + def mark_as_seen(**kwargs) + update_all(**kwargs.with_defaults(seen_at: Time.current, updated_at: Time.current)) + end + + def mark_as_unseen(**kwargs) + update_all(**kwargs.with_defaults(seen_at: nil, updated_at: Time.current)) end end diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index b3be0db4..af7b19f6 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -82,7 +82,7 @@ GEM base64 (0.2.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -120,7 +120,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -157,7 +157,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -198,7 +198,7 @@ GEM rake (13.2.1) regexp_parser (2.10.0) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -228,10 +228,10 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -245,7 +245,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index 0b720653..a8bddb2d 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -88,7 +88,7 @@ GEM base64 (0.2.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -126,7 +126,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -163,7 +163,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -204,7 +204,7 @@ GEM rake (13.2.1) regexp_parser (2.10.0) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -227,10 +227,10 @@ GEM multi_json (~> 1.10) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -244,7 +244,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index a02cee26..410dd2ef 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -98,7 +98,7 @@ GEM benchmark (0.4.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -140,7 +140,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -176,7 +176,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -224,13 +224,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.10.0) + rdoc (6.11.0) psych (>= 4.0.0) regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -254,10 +254,10 @@ GEM multi_json (~> 1.10) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -272,7 +272,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/gemfiles/rails_7_2.gemfile.lock b/gemfiles/rails_7_2.gemfile.lock index bd1dd331..a815ccf4 100644 --- a/gemfiles/rails_7_2.gemfile.lock +++ b/gemfiles/rails_7_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -92,7 +92,7 @@ GEM benchmark (0.4.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -134,7 +134,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -169,7 +169,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -217,13 +217,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.10.0) + rdoc (6.11.0) psych (>= 4.0.0) regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -247,10 +247,10 @@ GEM multi_json (~> 1.10) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -265,7 +265,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/gemfiles/rails_8_0.gemfile.lock b/gemfiles/rails_8_0.gemfile.lock index 04ba4c6e..b2e746ed 100644 --- a/gemfiles/rails_8_0.gemfile.lock +++ b/gemfiles/rails_8_0.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -92,7 +92,7 @@ GEM benchmark (0.4.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -134,7 +134,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -178,7 +178,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -226,13 +226,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.10.0) + rdoc (6.11.0) psych (>= 4.0.0) regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -262,10 +262,10 @@ GEM sqlite3 (2.5.0-x86_64-darwin) sqlite3 (2.5.0-x86_64-linux-gnu) sqlite3 (2.5.0-x86_64-linux-musl) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -280,7 +280,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index be8ba288..25520579 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 86312f5dc05b96d9c1c71ef03d257c155622f00e + revision: 1dcfe2316b4b239e2cf6cadd4efb7af4b4345e35 branch: main specs: actioncable (8.1.0.alpha) @@ -100,7 +100,7 @@ GIT PATH remote: .. specs: - noticed (2.5.1) + noticed (2.6.0) rails (>= 6.1.0) GEM @@ -120,7 +120,7 @@ GEM benchmark (0.4.0) bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) + concurrent-ruby (1.3.5) connection_pool (2.5.0) crack (1.0.0) bigdecimal @@ -162,7 +162,7 @@ GEM base64 language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.4) + logger (1.6.5) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -196,7 +196,7 @@ GEM racc (~> 1.4) os (1.1.4) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pg (1.5.9) @@ -222,13 +222,13 @@ GEM nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) rainbow (3.1.1) rake (13.2.1) - rdoc (6.10.0) + rdoc (6.11.0) psych (>= 4.0.0) regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -253,10 +253,10 @@ GEM sqlite3 (2.5.0-arm64-darwin) sqlite3 (2.5.0-x86_64-darwin) sqlite3 (2.5.0-x86_64-linux-gnu) - standard (1.43.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.69.1) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) @@ -271,7 +271,7 @@ GEM trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.3) + unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) diff --git a/lib/noticed/version.rb b/lib/noticed/version.rb index 4c623b4b..d0d32a1a 100644 --- a/lib/noticed/version.rb +++ b/lib/noticed/version.rb @@ -1,3 +1,3 @@ module Noticed - VERSION = "2.5.1" + VERSION = "2.6.0" end diff --git a/test/models/noticed/notification_test.rb b/test/models/noticed/notification_test.rb index 9b84eef2..1cd4d522 100644 --- a/test/models/noticed/notification_test.rb +++ b/test/models/noticed/notification_test.rb @@ -59,6 +59,24 @@ class Noticed::NotificationTest < ActiveSupport::TestCase assert_equal 0, Noticed::Notification.seen.count end + test "mark_as_read_and_seen" do + Noticed::Notification.update_all(read_at: nil, seen_at: nil) + assert_equal 0, Noticed::Notification.read.count + assert_equal 0, Noticed::Notification.seen.count + Noticed::Notification.mark_as_read_and_seen + assert_equal 4, Noticed::Notification.read.count + assert_equal 4, Noticed::Notification.seen.count + end + + test "mark_as_unread_and_unseen" do + Noticed::Notification.update_all(read_at: Time.current, seen_at: Time.current) + assert_equal 4, Noticed::Notification.read.count + assert_equal 4, Noticed::Notification.seen.count + Noticed::Notification.mark_as_unread_and_unseen + assert_equal 0, Noticed::Notification.read.count + assert_equal 0, Noticed::Notification.seen.count + end + test "read?" do assert noticed_notifications(:one).read? end