Guillermo - tests get/edit/recover-mail-templates [skip ci]
This commit is contained in:
parent
51357c2cd8
commit
d7cd5086bd
|
@ -48,3 +48,6 @@ require './system/add-department.rb'
|
|||
require './system/edit-department.rb'
|
||||
require './system/delete-department.rb'
|
||||
require './staff/last-events.rb'
|
||||
require './system/get-mail-templates.rb'
|
||||
require './system/edit-mail-template.rb'
|
||||
require './system/recover-mail-template.rb'
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
describe'system/edit-mail-template' do
|
||||
request('/user/logout')
|
||||
Scripts.login($staff[:email], $staff[:password], true)
|
||||
|
||||
it 'should edit mail template' do
|
||||
result= request('/system/edit-mail-template', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token,
|
||||
language: 'en',
|
||||
templateType: 'USER_SIGNUP',
|
||||
subject: 'new subject',
|
||||
body: 'new message'
|
||||
})
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
|
||||
row = $database.getRow('mailtemplate', 1, 'id')
|
||||
|
||||
(row['subject']).should.equal('new subject')
|
||||
(row['body']).should.equal('new message')
|
||||
end
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
describe'system/get-mail-templates' do
|
||||
request('/user/logout')
|
||||
Scripts.login($staff[:email], $staff[:password], true)
|
||||
|
||||
it 'should get mail templates' do
|
||||
result= request('/system/get-mail-templates', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token
|
||||
})
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
|
||||
(result['data'].size).should.equal(10)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,19 @@
|
|||
describe'system/recover-mail-template' do
|
||||
request('/user/logout')
|
||||
Scripts.login($staff[:email], $staff[:password], true)
|
||||
|
||||
it 'should recover mail template' do
|
||||
result= request('/system/recover-mail-template', {
|
||||
csrf_userid: $csrf_userid,
|
||||
csrf_token: $csrf_token,
|
||||
language: 'en',
|
||||
templateType: 'USER_SIGNUP',
|
||||
})
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
|
||||
row = $database.getRow('mailtemplate', 1, 'id')
|
||||
|
||||
(row['subject']).should.equal('Signup {{to}} - OpenSupports')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue