mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-01-12 22:53:00 +08:00
15 lines
379 B
Ruby
15 lines
379 B
Ruby
require 'test_helper'
|
|
|
|
class NotificationTest < ActiveSupport::TestCase
|
|
test "should inc user unread_notifications_count" do
|
|
user = create(:user)
|
|
assert_difference "user.notifications.unread.count" do
|
|
create(:notification, user: user)
|
|
end
|
|
|
|
assert_difference "user.notifications.unread.count", -1 do
|
|
user.notifications.last.destroy
|
|
end
|
|
end
|
|
end
|