alsways get the last message from inbucket (#6251)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-04-27 13:50:49 +02:00
коммит произвёл Joram Wilander
родитель 7307156c49
Коммит c540e80166

Просмотреть файл

@@ -1406,10 +1406,10 @@ func TestInviteUsersToTeam(t *testing.T) {
t.Log("No email was received, maybe due load on the server. Disabling this verification") t.Log("No email was received, maybe due load on the server. Disabling this verification")
} }
if err == nil && len(resultsMailbox) > 0 { if err == nil && len(resultsMailbox) > 0 {
if !strings.ContainsAny(resultsMailbox[0].To[0], email) { if !strings.ContainsAny(resultsMailbox[len(resultsMailbox)-1].To[0], email) {
t.Fatal("Wrong To recipient") t.Fatal("Wrong To recipient")
} else { } else {
if resultsEmail, err := utils.GetMessageFromMailbox(email, resultsMailbox[0].ID); err == nil { if resultsEmail, err := utils.GetMessageFromMailbox(email, resultsMailbox[len(resultsMailbox)-1].ID); err == nil {
if resultsEmail.Subject != expectedSubject { if resultsEmail.Subject != expectedSubject {
t.Log(resultsEmail.Subject) t.Log(resultsEmail.Subject)
t.Log(expectedSubject) t.Log(expectedSubject)