Skip to content

Commit

Permalink
#17 removing remove alias because its a reserved command
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdevwords authored and chrisdevwords committed May 29, 2017
1 parent dae4e24 commit 8c5d4a5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ When adding the slash commands to Slack be sure to point all commands at a POST
/dequeue all
```

### Remove is easier to spell than dequeue...
```
/remove all
```

### Get or set the default playlist.
```
# sets the playlist
Expand Down
1 change: 0 additions & 1 deletion src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ function exec({ text, user_name, command }) {
case '/queue':
return getQueue();
case '/dequeue':
case '/remove':
if (isNaN(text)) {
if (text.toLowerCase().trim() === 'all') {
return clearQueue(user_name)
Expand Down
41 changes: 0 additions & 41 deletions test/test_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,45 +754,4 @@ describe('The Slack commands for Spotify Local ', () => {


});

describe('The /remove command', () => {

const command = '/remove';
const user_name = 'david';

describe('does the same thing as /dequeue', () => {
const text = 'all';

beforeEach((done) => {
sinon.stub(request, 'delete')
.callsFake(() =>
openMock('local/spotify/api/queue/delete')
);
done();
});

afterEach((done) => {
request.delete.restore();
done();
});

it('resolves with text for slack', (done) => {
exec({ command, user_name, text })
.then((resp) => {
expect(resp).to.be.a('string');
expect(resp).to.eq(
'Queue cleared by david. Tracks removed:\n' +
'"Blood on Me" by Sampha requested by Donald\n' +
'"You Are in My System" by The System requested by Walter\n'+
'"Running Up That Hill (A Deal With God)" by Kate Bush requested by Jeff\n' +
'"JoHn Muir" by ScHoolboy Q requested by Donald\n' +
'"My Collection" by Future requested by Mike'
);
done();
})
.catch(done);
});
});
});

});

0 comments on commit 8c5d4a5

Please sign in to comment.