mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-06-19 15:41:32 +08:00
test of ticket/create
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
"day": "Day"
|
||||
},
|
||||
"notification_title": {
|
||||
"ticket": "<%= title %> | Ticket"
|
||||
"ticket": "__title__ | Ticket"
|
||||
},
|
||||
"view": {
|
||||
"layout": {
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"day": "天"
|
||||
},
|
||||
"notification_title": {
|
||||
"ticket": "<%= title %> | 工单"
|
||||
"ticket": "__title__ | 工单"
|
||||
},
|
||||
"view": {
|
||||
"layout": {
|
||||
|
||||
@@ -62,8 +62,9 @@ exports.post '/create', (req, res) ->
|
||||
id: ticket._id
|
||||
|
||||
notification.createGroupNotice 'root', 'ticket_create',
|
||||
title: _.template(res.t('notification_title.ticket')) ticket
|
||||
body: _.template(app.template_data['ticket_create_email'])
|
||||
title: res.t 'notification_title.ticket', ticket
|
||||
body: _.template(app.templates['ticket_create_email'])
|
||||
t: res.t
|
||||
ticket: ticket
|
||||
account: req.account
|
||||
config: config
|
||||
@@ -91,8 +92,9 @@ exports.post '/reply/:id', (req, res) ->
|
||||
_id: member_id
|
||||
, (err, account) ->
|
||||
notification.createNotice account, 'ticket_reply',
|
||||
title: _.template(res.t('notification_title.ticket')) ticket
|
||||
body: _.template(app.template_data['ticket_reply_email'])
|
||||
title: res.t 'notification_title.ticket', ticket
|
||||
body: _.template(app.templates['ticket_reply_email'])
|
||||
t: res.t
|
||||
ticket: ticket
|
||||
reply: reply
|
||||
account: req.account
|
||||
|
||||
@@ -1,12 +1,40 @@
|
||||
describe 'router/ticket', ->
|
||||
it 'GET list'
|
||||
agent = null
|
||||
csrf_token = null
|
||||
|
||||
it 'GET create'
|
||||
before ->
|
||||
{agent, csrf_token} = namespace.accountRouter
|
||||
|
||||
it 'GET create with not logged', (done) ->
|
||||
supertest app.express
|
||||
.get '/ticket/create'
|
||||
.redirects 0
|
||||
.expect 302
|
||||
.expect 'location', '/account/login/'
|
||||
.end done
|
||||
|
||||
it 'GET create', (done) ->
|
||||
agent.get '/ticket/create'
|
||||
.expect 200
|
||||
.end done
|
||||
|
||||
it 'POST create', (done) ->
|
||||
agent.post '/ticket/create'
|
||||
.send
|
||||
csrf_token: csrf_token
|
||||
title: 'Title'
|
||||
content: '**CONTENT**'
|
||||
.expect 200
|
||||
.end (err, res) ->
|
||||
created_objects.tickets.push res.body.id
|
||||
done err
|
||||
|
||||
it 'GET list'
|
||||
|
||||
it 'GET view/:id'
|
||||
|
||||
it 'POST create'
|
||||
|
||||
it 'POST reply'
|
||||
|
||||
it 'GET list when replied'
|
||||
|
||||
it 'POST update_status'
|
||||
|
||||
Reference in New Issue
Block a user