From c3b981dc91e3704fcc75bc5aa6799924aca0dd3f Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 17 Dec 2015 18:48:10 -0500 Subject: [PATCH] test(api): chat WIP --- test/api/v3/integration/chat/GET-chat.test.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/api/v3/integration/chat/GET-chat.test.js diff --git a/test/api/v3/integration/chat/GET-chat.test.js b/test/api/v3/integration/chat/GET-chat.test.js new file mode 100644 index 0000000000..4b4ebd9fdf --- /dev/null +++ b/test/api/v3/integration/chat/GET-chat.test.js @@ -0,0 +1,41 @@ +import { + createAndPopulateGroup, + generateUser, + requester, +} from '../../../../helpers/api-integration.helper'; + +describe.only('GET /groups/:groupId/chat', () => { + let user, api; + + before(() => { + return generateUser().then((generatedUser) => { + user = generatedUser; + api = requester(user); + }); + }); + + context('public Guild', () => { + let group; + + before(() => { + return createAndPopulateGroup({groupDetails: { + type: 'guild', + privacy: 'public', + chat: [ + 'Hello', + 'Welcome to the Guild', + ], + }}) + .then((createdGroup) => { + group = createdGroup; + }); + }); + + it('returns Guild chat', () => { + return api.get('/groups/' + group._id + '/chat') + .then((getChat) => { + expect(getChat).to.eql(group.chat); + }); + }); + }); +});