opensupports/tests/system/edit-department.rb

23 lines
695 B
Ruby

describe'system/edit-department' do
request('/user/logout')
Scripts.login($staff[:email], $staff[:password], true)
it 'should edit department' do
result= request('/system/edit-department', {
csrf_userid: $csrf_userid,
csrf_token: $csrf_token,
name: 'second name',
departmentId: 4
})
(result['status']).should.equal('success')
row = $database.getRow('department', 4, 'id')
(row['name']).should.equal('second name')
lastLog = $database.getLastRow('log')
(lastLog['type']).should.equal('EDIT_DEPARTMENT')
end
end