Do not log empty statuses in the InOutBoard.
This commit is contained in:
parent
1ccb468914
commit
564378bba8
3 changed files with 32 additions and 5 deletions
|
|
@ -18,7 +18,7 @@ use Test::MockObject::Extends;
|
|||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use Test::More tests => 6; # increment this value for each test you create
|
||||
use Test::More tests => 8; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
use Data::Dumper;
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ my $templateMock = Test::MockObject->new({});
|
|||
$templateMock->set_isa('WebGUI::Asset::Template');
|
||||
$templateMock->set_always('getId', $templateId);
|
||||
my $templateVars;
|
||||
$templateMock->mock('prepare', sub { } );
|
||||
$templateMock->mock('process', sub { $templateVars = $_[1]; } );
|
||||
$templateMock->set_true('prepare');
|
||||
|
||||
|
|
@ -102,6 +103,29 @@ cmp_deeply(
|
|||
},
|
||||
'... set statusLog for a user'
|
||||
);
|
||||
|
||||
$session->scratch->set('userId', $users[1]->userId);
|
||||
$session->request->setup_body({
|
||||
delegate => $users[1]->userId,
|
||||
status => undef,
|
||||
message => 'work time',
|
||||
});
|
||||
$board->www_setStatus;
|
||||
$status = $session->db->quickHashRef('select * from InOutBoard_status where assetId=? and userId=?',[$board->getId, $users[1]->userId]);
|
||||
cmp_deeply(
|
||||
$status,
|
||||
{ },
|
||||
"... no status table entry made when the users's status is blank"
|
||||
);
|
||||
my $statusLog;
|
||||
$statusLog = $session->db->quickHashRef('select * from InOutBoard_statusLog where assetId=? and userId=?',[$board->getId, $users[1]->userId]);
|
||||
cmp_deeply(
|
||||
$statusLog,
|
||||
{ },
|
||||
'... no statusLog set when status is blank'
|
||||
);
|
||||
|
||||
|
||||
$session->request->setup_body({ });
|
||||
$session->scratch->delete('userId');
|
||||
|
||||
|
|
@ -123,7 +147,8 @@ cmp_bag(
|
|||
username => 'red',
|
||||
},
|
||||
ignore(), ignore(), ignore(), ignore(),
|
||||
]
|
||||
],
|
||||
'view: returns one entry for each user, entry is correct for user with status'
|
||||
);
|
||||
|
||||
WebGUI::Test->unmockAssetId($templateId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue