FEATURE: suggested messages for messages

FEATURE: clicking envelope takes you to inbox

Suggested messages works somewhat like suggested topics.

- New show up first (in either group inbox or inbox)
- Then unread (in either group inbox or inbox)
- Finally "related" which are messages with same participants as the current pm.
This commit is contained in:
Sam Saffron
2016-02-03 18:50:05 +11:00
parent 133fcef72c
commit bc75010b20
14 changed files with 296 additions and 27 deletions

View File

@ -325,13 +325,13 @@ describe PostCreator do
end
it "fails for dupe post accross topic" do
first = create_post
second = create_post
first = create_post(raw: "this is a test #{SecureRandom.hex}")
second = create_post(raw: "this is a test #{SecureRandom.hex}")
dupe = "hello 123 test #{SecureRandom.hex}"
response_1 = create_post(raw: dupe, user: first.user, topic_id: first.topic_id)
response_2 = create_post(raw: dupe, user: first.user, topic_id: second.topic_id)
response_1 = PostCreator.create(first.user, raw: dupe, topic_id: first.topic_id)
response_2 = PostCreator.create(first.user, raw: dupe, topic_id: second.topic_id)
expect(response_1.errors.count).to eq(0)
expect(response_2.errors.count).to eq(1)