Skip to content
Extraits de code Groupes Projets
Valider 53714c46 rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Fix notification for new conversations

parent a19b9108
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -20,7 +20,7 @@ class Conversation < ActiveRecord::Base
def max_participants
errors.add(:max_participants, "too many participants") if participants.count > 20
end
def local_recipients
recipients.each do |recipient|
if recipient.local?
......@@ -86,7 +86,7 @@ class Conversation < ActiveRecord::Base
end
def receive(user, person)
cnv = Conversation.find_or_create_by!(self.attributes)
cnv = Conversation.create_with(self.attributes).find_or_create_by!(guid: guid)
self.participants.each do |participant|
ConversationVisibility.find_or_create_by(conversation_id: cnv.id, person_id: participant.id)
......
......@@ -20,5 +20,7 @@ Feature: private conversations
And "Alice Awesome" should be part of active conversation
And I should see "hello, alice!" within ".stream_container"
When I sign in as "alice@alice.alice"
And I reply with "hey, how you doing?"
Then I should have 1 unread private message
And I should have 1 email delivery
When I reply with "hey, how you doing?"
Then I should see "hey, how you doing?" within ".stream_container"
......@@ -4,6 +4,10 @@ Then /^"([^"]*)" should be part of active conversation$/ do |name|
end
end
Then /^I should have (\d+) unread private messages?$/ do |n_unread|
find("header #conversations_badge .badge_count").should have_content(n_unread)
end
Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person|
step %(I am on the conversations page)
within("#conversation_new", match: :first) do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter