mirror of
https://github.com/wahyd4/sohub.git
synced 2026-08-09 04:56:09 +10:00
try to fix set display name bug
This commit is contained in:
@@ -29,7 +29,7 @@ var WeixinService = {
|
||||
} else if (content === 'menu' || content === 'm') {
|
||||
callback(null, constants.reply.menu);
|
||||
return;
|
||||
} else if (new RegExp('^[=]{1}[^=-+]*$').test(content)) {
|
||||
} else if (new RegExp('^[=]{1}[^=+-]*$').test(content)) {
|
||||
ActionsService.setDisplayName(message.FromUserName, content, function (err, result) {
|
||||
if (err) {
|
||||
callback(null, contants.reply.systemErr);
|
||||
|
||||
@@ -2,12 +2,12 @@ var actionService = require('../api/services/ActionService.js');
|
||||
var assert = require('assert');
|
||||
|
||||
describe('ActionService test',function(){
|
||||
it('should set display name success',function(){
|
||||
var origionalName = '';
|
||||
var newName = '=Test';
|
||||
actionService.setDisplayName(origionalName,newName,function(err,result){
|
||||
return result;
|
||||
});
|
||||
|
||||
});
|
||||
// it('should set display name success',function(){
|
||||
// var origionalName = '';
|
||||
// var newName = '=Test';
|
||||
// actionService.setDisplayName(origionalName,newName,function(err,result){
|
||||
// return result;
|
||||
// });
|
||||
//
|
||||
// });
|
||||
});
|
||||
|
||||
@@ -57,4 +57,11 @@ describe('Sohub', function () {
|
||||
|
||||
});
|
||||
|
||||
|
||||
describe('action pattern test',function(){
|
||||
it('should be set display name action',function(){
|
||||
assert.equal(new RegExp('^[=]{1}[^=+-]*$').test('=junv'),true);
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user