From 4793970e87472b8dad33840e90963068030c5c23 Mon Sep 17 00:00:00 2001 From: nxshock Date: Sat, 3 Aug 2019 11:59:52 +0500 Subject: [PATCH] Add room state test --- internal/backends/memory/rooms_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/backends/memory/rooms_test.go b/internal/backends/memory/rooms_test.go index 4ca4103..a633057 100644 --- a/internal/backends/memory/rooms_test.go +++ b/internal/backends/memory/rooms_test.go @@ -17,7 +17,8 @@ func TestCreateRoom(t *testing.T) { request := createroom.Request{ RoomAliasName: "room1", Name: "room1", - Topic: "topic"} + Topic: "topic", + Preset: createroom.PublicChat} room, err := user.CreateRoom(request) assert.NoError(t, err) @@ -25,6 +26,7 @@ func TestCreateRoom(t *testing.T) { assert.Equal(t, request.Name, room.Name()) assert.Equal(t, request.Topic, room.Topic()) assert.Equal(t, user.ID(), room.Creator().ID()) + assert.Equal(t, request.Preset, room.State()) assert.Equal(t, 1, len(backend.rooms)) assert.Equal(t, "!"+room.(*Room).id+":"+backend.hostname, room.ID()) }