Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
c4376361
Commit
c4376361
authored
Nov 12, 2012
by
Jason Robinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix message_spec test and add tests for private message notification unread count. Update changelog
parent
6cf6f1dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
Changelog.md
Changelog.md
+1
-0
spec/models/message_spec.rb
spec/models/message_spec.rb
+2
-2
spec/models/notifications/private_message_spec.rb
spec/models/notifications/private_message_spec.rb
+25
-0
No files found.
Changelog.md
View file @
c4376361
...
...
@@ -41,6 +41,7 @@
*
Fix misconfiguration of Devise to allow the session to be remembered.
[
#3472
](
https://github.com/diaspora/diaspora/issues/3472
)
*
Fix problem with show reshares_count in stream.
[
#3700
](
https://github.com/diaspora/diaspora/pull/3700
)
*
Fix error with notifications count in mobile.
[
#3721
](
https://github.com/diaspora/diaspora/pull/3721
)
*
Fix conversation unread message count bug.
[
#2321
](
https://github.com/diaspora/diaspora/issues/2321
)
## Gem updates
...
...
spec/models/message_spec.rb
View file @
c4376361
...
...
@@ -96,12 +96,12 @@ describe Message do
let
(
:build_object
)
{
Message
.
new
(
:author
=>
@alice
.
person
,
:text
=>
"ohai!"
,
:conversation
=>
@conversation
)
}
it_should_behave_like
'it is relayable'
describe
'#
after_receive
'
do
describe
'#
increase_unread
'
do
it
'increments the conversation visiblity for the conversation'
do
ConversationVisibility
.
where
(
:conversation_id
=>
@object_by_recipient
.
reload
.
conversation
.
id
,
:person_id
=>
@local_luke
.
person
.
id
).
first
.
unread
.
should
==
0
@object_by_recipient
.
receive
(
@local_luke
,
@local_leia
.
person
)
@object_by_recipient
.
increase_unread
(
@local_luke
)
ConversationVisibility
.
where
(
:conversation_id
=>
@object_by_recipient
.
reload
.
conversation
.
id
,
:person_id
=>
@local_luke
.
person
.
id
).
first
.
unread
.
should
==
1
end
...
...
spec/models/notifications/private_message_spec.rb
View file @
c4376361
...
...
@@ -40,6 +40,31 @@ describe Notifications::PrivateMessage do
@user2
.
should_receive
(
:mail
)
n
.
email_the_user
(
@msg
,
@user1
.
person
)
end
it
'increases user unread count - author user 1'
do
message
=
@cnv
.
messages
.
build
(
:text
=>
"foo bar"
,
:author
=>
@user1
.
person
)
message
.
save
n
=
Notifications
::
PrivateMessage
.
make_notification
(
@user2
,
message
,
@user1
.
person
,
Notifications
::
PrivateMessage
)
ConversationVisibility
.
where
(
:conversation_id
=>
message
.
reload
.
conversation
.
id
,
:person_id
=>
@user2
.
person
.
id
).
first
.
unread
.
should
==
1
end
it
'increases user unread count - author user 2'
do
message
=
@cnv
.
messages
.
build
(
:text
=>
"foo bar"
,
:author
=>
@user2
.
person
)
message
.
save
n
=
Notifications
::
PrivateMessage
.
make_notification
(
@user1
,
message
,
@user2
.
person
,
Notifications
::
PrivateMessage
)
ConversationVisibility
.
where
(
:conversation_id
=>
message
.
reload
.
conversation
.
id
,
:person_id
=>
@user1
.
person
.
id
).
first
.
unread
.
should
==
1
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment