mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-30 10:25:40 +02:00
Associate messages with a user
This commit is contained in:
parent
84785b7a60
commit
2b78a8cb51
7 changed files with 71 additions and 41 deletions
server
|
@ -1151,7 +1151,7 @@ func TestServer_PublishAttachment(t *testing.T) {
|
|||
require.Equal(t, "", response.Body.String())
|
||||
|
||||
// Slightly unrelated cross-test: make sure we add an owner for internal attachments
|
||||
size, err := s.messageCache.AttachmentBytesUsed("9.9.9.9") // See request()
|
||||
size, err := s.messageCache.AttachmentBytesUsedBySender("9.9.9.9") // See request()
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, int64(5000), size)
|
||||
}
|
||||
|
@ -1180,7 +1180,7 @@ func TestServer_PublishAttachmentShortWithFilename(t *testing.T) {
|
|||
require.Equal(t, content, response.Body.String())
|
||||
|
||||
// Slightly unrelated cross-test: make sure we add an owner for internal attachments
|
||||
size, err := s.messageCache.AttachmentBytesUsed("1.2.3.4")
|
||||
size, err := s.messageCache.AttachmentBytesUsedBySender("1.2.3.4")
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, int64(21), size)
|
||||
}
|
||||
|
@ -1200,7 +1200,7 @@ func TestServer_PublishAttachmentExternalWithoutFilename(t *testing.T) {
|
|||
require.Equal(t, netip.Addr{}, msg.Sender)
|
||||
|
||||
// Slightly unrelated cross-test: make sure we don't add an owner for external attachments
|
||||
size, err := s.messageCache.AttachmentBytesUsed("127.0.0.1")
|
||||
size, err := s.messageCache.AttachmentBytesUsedBySender("127.0.0.1")
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, int64(0), size)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue