updated tests

This commit is contained in:
Wyatt Johnson
2017-08-20 12:54:46 -06:00
parent 5036a2665a
commit 7125250cd6
6 changed files with 138 additions and 40 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ module.exports = class ActionsService {
* @param {String} action the new action to the item
* @return {Promise}
*/
static async insertUserAction(action) {
static async create(action) {
// Actions are made unique by using a query that can be reproducable, i.e.,
// not containing user inputable values.
+2 -2
View File
@@ -280,7 +280,7 @@ module.exports = class CommentsService {
* @return {Promise}
*/
static addAction(item_id, user_id, action_type, metadata = {}) {
return ActionsService.insertUserAction({
return ActionsService.create({
item_id,
item_type: 'COMMENTS',
user_id,
@@ -301,7 +301,7 @@ const incrActionCounts = async (action, value) => {
[`action_counts.${ACTION_TYPE}`]: value,
};
if (action.group_id !== null && action.group_id.length > 0) {
if (action.group_id && action.group_id.length > 0) {
const GROUP_ID = sc(action.group_id.toLowerCase());
update[`action_counts.${ACTION_TYPE}_${GROUP_ID}`] = value;
+1 -1
View File
@@ -737,7 +737,7 @@ module.exports = class UsersService {
* @return {Promise}
*/
static addAction(item_id, user_id, action_type, metadata) {
return ActionsService.insertUserAction({
return ActionsService.create({
item_id,
item_type: 'users',
user_id,