Merge pull request #6899 from svbergerem/cuke-notification-hidden-conversation

Add cuke for deleting conversations
This commit is contained in:
Dennis Schubert 2016-06-30 04:51:36 +02:00
commit cb1bfc2b3b
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
3 changed files with 22 additions and 1 deletions

View file

@ -2,9 +2,11 @@ var response = <%= raw @response.to_json %>;
<% if session[:mobile_view] %>
window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
<% else %>
app.flashMessages._flash(response.message, response.success);
if(response.success){
app.flashMessages.success(response.message);
$("#new_conversation").removeClass('form_do_not_clear').clearForm();
window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
} else {
app.flashMessages.error(response.message);
}
<% end %>

View file

@ -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

View file

@ -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