mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-29 16:54:53 +02:00
fix test ruby
This commit is contained in:
parent
94a8cd4431
commit
69d0c58172
@ -30,7 +30,7 @@ class EmailPollingController extends Controller {
|
|||||||
throw new RequestException(ERRORS::INVALID_TOKEN);
|
throw new RequestException(ERRORS::INVALID_TOKEN);
|
||||||
|
|
||||||
if(Controller::isUserSystemEnabled())
|
if(Controller::isUserSystemEnabled())
|
||||||
throw new RequestException(ERRORS::USER_SYSTEM);
|
throw new RequestException(ERRORS::USER_SYSTEM_ENABLED);
|
||||||
|
|
||||||
$this->mailbox = new \PhpImap\Mailbox(
|
$this->mailbox = new \PhpImap\Mailbox(
|
||||||
Setting::getSetting('imap-host')->getValue(),
|
Setting::getSetting('imap-host')->getValue(),
|
||||||
|
@ -95,7 +95,7 @@ class CommentController extends Controller {
|
|||||||
'staff' => true
|
'staff' => true
|
||||||
]);
|
]);
|
||||||
} else if($isOwner) {
|
} else if($isOwner) {
|
||||||
$this->sendMail($ticketAuthor);
|
!Controller::request('private') ? $this->sendMail($ticketAuthor) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::createLog('COMMENT', $this->ticket->ticketNumber);
|
Log::createLog('COMMENT', $this->ticket->ticketNumber);
|
||||||
@ -151,12 +151,12 @@ class CommentController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$mailSender->setTemplate(MailTemplate::TICKET_RESPONDED, [
|
$mailSender->setTemplate(MailTemplate::TICKET_RESPONDED, [
|
||||||
'to' => $email,
|
'to' => $email,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'title' => $this->ticket->title,
|
'title' => $this->ticket->title,
|
||||||
'ticketNumber' => $this->ticket->ticketNumber,
|
'ticketNumber' => $this->ticket->ticketNumber,
|
||||||
'content' => $this->content,
|
'content' => $this->content,
|
||||||
'url' => $url
|
'url' => $url
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$mailSender->send();
|
$mailSender->send();
|
||||||
|
@ -62,6 +62,7 @@ class EditCommentController extends Controller {
|
|||||||
$ticket->store();
|
$ticket->store();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Response::respondSuccess();
|
Response::respondSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,13 @@ class Scripts
|
|||||||
color: color
|
color: color
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
def self.assignTicket(ticketnumber)
|
||||||
|
request('/staff/assign-ticket', {
|
||||||
|
ticketNumber: ticketnumber,
|
||||||
|
csrf_userid: $csrf_userid,
|
||||||
|
csrf_token: $csrf_token
|
||||||
|
})
|
||||||
|
end
|
||||||
def self.commentTicket(ticketnumber,content)
|
def self.commentTicket(ticketnumber,content)
|
||||||
request('/ticket/comment', {
|
request('/ticket/comment', {
|
||||||
content: content,
|
content: content,
|
||||||
|
@ -71,12 +71,15 @@ describe '/ticket/edit-comment' do
|
|||||||
|
|
||||||
|
|
||||||
it 'should not change the content of a comment if the user is not the author' do
|
it 'should not change the content of a comment if the user is not the author' do
|
||||||
|
request('/user/logout')
|
||||||
Scripts.login($staff[:email], $staff[:password], true)
|
Scripts.login($staff[:email], $staff[:password], true)
|
||||||
|
|
||||||
ticket = $database.getRow('ticket', 'ticket made by an user', 'title')
|
ticket = $database.getRow('ticket', 'ticket made by an user', 'title')
|
||||||
Scripts.commentTicket(ticket['ticket_number'],'comment by a staffffff')
|
|
||||||
|
|
||||||
ticketevent = $database.getRow('ticketevent', 'comment by a staffffff', 'content')
|
Scripts.assignTicket(ticket['ticket_number'])
|
||||||
|
Scripts.commentTicket(ticket['ticket_number'],'this is a new comment of a staff member')
|
||||||
|
|
||||||
|
ticketevent = $database.getRow('ticketevent', 'this is a new comment of a staff member', 'content')
|
||||||
|
|
||||||
request('/user/logout')
|
request('/user/logout')
|
||||||
Scripts.login();
|
Scripts.login();
|
||||||
@ -84,7 +87,7 @@ describe '/ticket/edit-comment' do
|
|||||||
result = request('/ticket/edit-comment', {
|
result = request('/ticket/edit-comment', {
|
||||||
csrf_userid: $csrf_userid,
|
csrf_userid: $csrf_userid,
|
||||||
csrf_token: $csrf_token,
|
csrf_token: $csrf_token,
|
||||||
content: 'comment edited by a user',
|
content: 'comment edited by an user',
|
||||||
ticketEventId: ticketevent['id']
|
ticketEventId: ticketevent['id']
|
||||||
})
|
})
|
||||||
(result['status']).should.equal('fail')
|
(result['status']).should.equal('fail')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user