Update SendMessage for new protocol
This commit is contained in:
@@ -118,7 +118,7 @@ func TestMessages(t *testing.T) {
|
||||
|
||||
server.Server.AppendMessageToConversation(&conversation, message)
|
||||
|
||||
resp, err := http.Get(httpServer.URL + "/messages?guid=" + *&conversation.Guid)
|
||||
resp, err := http.Get(httpServer.URL + "/messages?guid=" + conversation.Guid)
|
||||
if err != nil {
|
||||
t.Fatalf("TestMessages error: %s", err)
|
||||
}
|
||||
@@ -237,7 +237,7 @@ func TestAuthentication(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdates(t *testing.T) {
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: true})
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: false})
|
||||
httpServer := httptest.NewServer(s)
|
||||
|
||||
messageSeq := 0
|
||||
@@ -396,7 +396,7 @@ func TestUpdatesWebsocket(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMarkConversation(t *testing.T) {
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: true})
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: false})
|
||||
httpServer := httptest.NewServer(s)
|
||||
|
||||
// Mock conversation
|
||||
@@ -439,7 +439,7 @@ func TestMarkConversation(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMessageQueries(t *testing.T) {
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: true})
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: false})
|
||||
httpServer := httptest.NewServer(s)
|
||||
|
||||
// Mock conversation
|
||||
@@ -536,7 +536,7 @@ func TestMessageQueries(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendMessage(t *testing.T) {
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: true})
|
||||
s := web.NewMockHTTPServer(web.MockHTTPServerConfiguration{AuthEnabled: false})
|
||||
httpServer := httptest.NewServer(s)
|
||||
|
||||
// Mock conversation
|
||||
@@ -578,7 +578,7 @@ func TestSendMessage(t *testing.T) {
|
||||
t.Fatalf("Error decoding body: %s", body)
|
||||
}
|
||||
|
||||
var response web.SendMessageResponse
|
||||
var response model.Message
|
||||
err = json.Unmarshal(body, &response)
|
||||
if err != nil {
|
||||
t.Fatalf("Error unmarshalling JSON: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user