1 /* global describe:true, it:true */
4 var USER = { username: 'gittertestbot' };
5 var badgerService = require('../lib/badger-service');
6 var client = badgerService.testOnly.client;
8 describe('badger-service #slow', function() {
9 // Skip tests in the automated test as they create too much noise
11 process.env.NODE_ENV === 'test' ||
12 process.env.NODE_ENV === 'test-docker' ||
13 process.env.SKIP_BADGER_TESTS
18 it('should create pull requests for repos that do not have a master branch', function() {
19 var uri = 'gittertestbot/does-not-have-a-master-branch';
20 return badgerService.sendBadgePullRequest(uri, uri, USER).finally(function() {
22 .del('/repos/gitter-badger/does-not-have-a-master-branch', {})
23 .catch(function() {});
27 it('should create pull requests for repos that do not have a README markdown', function() {
28 var uri = 'gittertestbot/no-readme-markdown-file-2';
29 return badgerService.sendBadgePullRequest(uri, uri, USER).finally(function() {
30 return client.del('/repos/gitter-badger/no-readme-markdown-file-2', {}).catch(function() {});
34 it('should create pull requests for repos that have a README.markdown', function() {
35 var uri = 'gittertestbot/readme-dot-markdown';
36 var roomUri = 'gittertestbot/community';
37 return badgerService.sendBadgePullRequest(uri, roomUri, USER).finally(function() {
38 return client.del('/repos/gitter-badger/readme-dot-markdown', {}).catch(function() {});
42 it('should create pull requests for repos that have a textile readme', function() {
43 var uri = 'gittertestbot/readme-dot-textile';
44 return badgerService.sendBadgePullRequest(uri, uri, USER).finally(function() {
45 return client.del('/repos/gitter-badger/readme-dot-textile', {}).catch(function() {});
49 it('should create pull requests for repos that have a rst readme', function() {
50 var uri = 'gittertestbot/readme-dot-rst';
51 return badgerService.sendBadgePullRequest(uri, uri, USER).finally(function() {
52 return client.del('/repos/gitter-badger/readme-dot-rst', {}).catch(function() {});
56 it('should create pull requests for repos that have a plaintext readme', function() {
57 var uri = 'gittertestbot/readme-dot-txt';
58 var roomUri = 'gittertestbot/community';
59 return badgerService.sendBadgePullRequest(uri, roomUri, USER).finally(function() {
60 return client.del('/repos/gitter-badger/readme-dot-txt', {}).catch(function() {});