Compressing variables from postAction into single object.

This commit is contained in:
David Jay
2016-12-08 14:27:31 -05:00
parent f8923aa283
commit fc96c1ee91
5 changed files with 18 additions and 12 deletions
@@ -155,7 +155,11 @@ describe('itemActions', () => {
describe('postAction', () => {
it ('should post an action', () => {
fetchMock.post('*', {id: '456'});
return actions.postAction('abc', 'flag', 'comments', 'Comment smells funny')(store.dispatch)
const action = {
action_type: 'flag',
detail: 'Comment smells funny'
};
return actions.postAction('abc', 'comments', action)(store.dispatch)
.then(response => {
expect(fetchMock.calls().matched[0][0]).to.equal('/api/v1/comments/abc/actions');
expect(response).to.deep.equal({id:'456'});