attachments: Should be /attachment, not /fetchAttachment
This commit is contained in:
@@ -153,6 +153,7 @@ func (s *Server) PopulateWithTestData() {
|
|||||||
log.Fatal().Msgf("Error storing test attachment: %s", err)
|
log.Fatal().Msgf("Error storing test attachment: %s", err)
|
||||||
} else {
|
} else {
|
||||||
attachmentMessage := data.GenerateAttachmentMessage(attachmentConversation.Participants, *attachmentGUID)
|
attachmentMessage := data.GenerateAttachmentMessage(attachmentConversation.Participants, *attachmentGUID)
|
||||||
|
attachmentMessage.Date = model.Date(time.Now())
|
||||||
s.AppendMessageToConversation(&attachmentConversation, attachmentMessage)
|
s.AppendMessageToConversation(&attachmentConversation, attachmentMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ func NewMockHTTPServer(config MockHTTPServerConfiguration) *MockHTTPServer {
|
|||||||
this.mux.Handle("/pollUpdates", http.HandlerFunc(this.handlePollUpdates))
|
this.mux.Handle("/pollUpdates", http.HandlerFunc(this.handlePollUpdates))
|
||||||
this.mux.Handle("/sendMessage", http.HandlerFunc(this.handleSendMessage))
|
this.mux.Handle("/sendMessage", http.HandlerFunc(this.handleSendMessage))
|
||||||
this.mux.Handle("/markConversation", http.HandlerFunc(this.handleMarkConversation))
|
this.mux.Handle("/markConversation", http.HandlerFunc(this.handleMarkConversation))
|
||||||
this.mux.Handle("/fetchAttachment", http.HandlerFunc(this.handleFetchAttachment))
|
this.mux.Handle("/attachment", http.HandlerFunc(this.handleFetchAttachment))
|
||||||
this.mux.Handle("/uploadAttachment", http.HandlerFunc(this.handleUploadAttachment))
|
this.mux.Handle("/uploadAttachment", http.HandlerFunc(this.handleUploadAttachment))
|
||||||
this.mux.Handle("/updates", http.HandlerFunc(this.handleUpdates))
|
this.mux.Handle("/updates", http.HandlerFunc(this.handleUpdates))
|
||||||
|
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ func TestAttachments(t *testing.T) {
|
|||||||
defer s.Server.DeleteAttachment(guid)
|
defer s.Server.DeleteAttachment(guid)
|
||||||
|
|
||||||
// Fetch it back
|
// Fetch it back
|
||||||
resp, err = http.Get(httpServer.URL + fmt.Sprintf("/fetchAttachment?guid=%s", guid))
|
resp, err = http.Get(httpServer.URL + fmt.Sprintf("/attachment?guid=%s", guid))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error fetching attachment: %s", err)
|
t.Fatalf("Error fetching attachment: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user