Merge branch 'notifications_count' of git://github.com/movilla/diaspora into develop
This commit is contained in:
commit
63f2d335a4
3 changed files with 7 additions and 4 deletions
|
|
@ -40,6 +40,7 @@
|
||||||
* Fix error with invite link box shows on search results page even if invites have been turned off. [#3708](https://github.com/diaspora/diaspora/pull/3708)
|
* Fix error with invite link box shows on search results page even if invites have been turned off. [#3708](https://github.com/diaspora/diaspora/pull/3708)
|
||||||
* Fix misconfiguration of Devise to allow the session to be remembered. [#3472](https://github.com/diaspora/diaspora/issues/3472)
|
* 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 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)
|
||||||
|
|
||||||
## Gem updates
|
## Gem updates
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ class PostsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def mark_corresponding_notification_read
|
def mark_corresponding_notification_read
|
||||||
if notification = Notification.where(:recipient_id => current_user.id, :target_id => @post.id).first
|
if notification = Notification.where(:recipient_id => current_user.id, :target_id => @post.id, :unread => true).first
|
||||||
notification.unread = false
|
notification.unread = false
|
||||||
notification.save
|
notification.save
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,14 @@ describe PostsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'marks a corresponding notification as read' do
|
it 'marks a corresponding notification as read' do
|
||||||
note = Notification.create(:recipient => alice, :target => @message, :unread => true)
|
# Ensure that it doesn't mark a read notification as read
|
||||||
|
FactoryGirl.create(:notification, :recipient => alice, :target => @message, :unread => false)
|
||||||
|
note = FactoryGirl.create(:notification, :recipient => alice, :target => @message, :unread => true)
|
||||||
|
|
||||||
lambda{
|
expect {
|
||||||
get :show, :id => @message.id
|
get :show, :id => @message.id
|
||||||
note.reload
|
note.reload
|
||||||
}.should change(note, :unread).from(true).to(false)
|
}.to change(note, :unread).from(true).to(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'succeeds with a AS/photo' do
|
it 'succeeds with a AS/photo' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue