From e67c3ace74a05fbd951acd2bd7ca09640d445e58 Mon Sep 17 00:00:00 2001
From: Steffen van Bergerem <svbergerem@online.de>
Date: Wed, 29 Jun 2016 21:37:26 +0200
Subject: [PATCH] Add cuke for deleting conversations

---
 features/desktop/conversations.feature           | 15 +++++++++++++++
 features/step_definitions/conversations_steps.rb |  4 ++++
 2 files changed, 19 insertions(+)

diff --git a/features/desktop/conversations.feature b/features/desktop/conversations.feature
index d1186ae6b7..2f152b8ef8 100644
--- a/features/desktop/conversations.feature
+++ b/features/desktop/conversations.feature
@@ -43,3 +43,18 @@ Feature: private conversations
     When I sign in as "alice@alice.alice"
     Then I should have 2 unread private messages
     And I should have 2 email delivery
+
+  Scenario: delete a conversation
+    When I sign in as "bob@bob.bob"
+    And I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome"
+    Then I should see "Greetings" within "#conversation_inbox"
+    When I click on selector ".hide_conversation"
+    Then I should not see "Greetings" within "#conversation_inbox"
+    When I sign in as "alice@alice.alice"
+    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"
+    When I sign in as "bob@bob.bob"
+    Then I should have 1 email delivery
+    And I should have no unread private messages
diff --git a/features/step_definitions/conversations_steps.rb b/features/step_definitions/conversations_steps.rb
index c146902b52..918e834d0e 100644
--- a/features/step_definitions/conversations_steps.rb
+++ b/features/step_definitions/conversations_steps.rb
@@ -8,6 +8,10 @@ Then /^I should have (\d+) unread private messages?$/ do |n_unread|
   expect(find("header #conversations-link .badge")).to have_content(n_unread)
 end
 
+Then /^I should have no unread private messages$/ do
+  expect(page).to have_no_css "header #conversations-link .badge"
+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
-- 
GitLab