Skip to content

Commit

Permalink
get the latest message from the mailbox. It fixes the issue PLT-6176 (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato authored and coreyhulen committed Apr 7, 2017
1 parent 1bd19f0 commit f7b39ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,10 @@ func TestEmailMention(t *testing.T) {
t.Log("No email was received, maybe due load on the server. Disabling this verification")
}
if err == nil && len(resultsMailbox) > 0 {
if !strings.ContainsAny(resultsMailbox[0].To[0], th.BasicUser2.Email) {
if !strings.ContainsAny(resultsMailbox[len(resultsMailbox)-1].To[0], th.BasicUser2.Email) {
t.Fatal("Wrong To recipient")
} else {
if resultsEmail, err := utils.GetMessageFromMailbox(th.BasicUser2.Email, resultsMailbox[0].ID); err == nil {
if resultsEmail, err := utils.GetMessageFromMailbox(th.BasicUser2.Email, resultsMailbox[len(resultsMailbox)-1].ID); err == nil {
if !strings.Contains(resultsEmail.Body.Text, post1.Message) {
t.Log(resultsEmail.Body.Text)
t.Fatal("Received wrong Message")
Expand Down

0 comments on commit f7b39ca

Please sign in to comment.