Lines 49-55
my $new_suggestion_2 = Koha::Suggestion->new(
Link Here
|
49 |
)->store; |
49 |
)->store; |
50 |
|
50 |
|
51 |
subtest 'store' => sub { |
51 |
subtest 'store' => sub { |
52 |
plan tests => 3; |
52 |
plan tests => 5; |
53 |
my $suggestion = Koha::Suggestion->new( |
53 |
my $suggestion = Koha::Suggestion->new( |
54 |
{ suggestedby => $patron->{borrowernumber}, |
54 |
{ suggestedby => $patron->{borrowernumber}, |
55 |
biblionumber => $biblio_1->biblionumber, |
55 |
biblionumber => $biblio_1->biblionumber, |
Lines 65-70
subtest 'store' => sub {
Link Here
|
65 |
$suggestion->reason('because!')->store; |
65 |
$suggestion->reason('because!')->store; |
66 |
$suggestion = Koha::Suggestions->find( $suggestion->suggestionid ); |
66 |
$suggestion = Koha::Suggestions->find( $suggestion->suggestionid ); |
67 |
is( $suggestion->suggesteddate, $two_days_ago_sql, 'If suggestion id modified, suggesteddate should not be modified' ); |
67 |
is( $suggestion->suggesteddate, $two_days_ago_sql, 'If suggestion id modified, suggesteddate should not be modified' ); |
|
|
68 |
|
69 |
throws_ok { |
70 |
$suggestion->STATUS('UNKNOWN')->store; |
71 |
} |
72 |
'Koha::Exceptions::Suggestion::StatusForbidden', |
73 |
'store raises an exception on invalid STATUS'; |
74 |
|
75 |
|
76 |
my $authorised_value = Koha::AuthorisedValue->new({category => 'SUGGEST_STATUS', |
77 |
authorised_value => 'UNKNOWN'})->store; |
78 |
$suggestion->STATUS('UNKNOWN')->store; |
79 |
is($suggestion->STATUS,'UNKNOWN',"UNKNOWN status stored"); |
68 |
$suggestion->delete; |
80 |
$suggestion->delete; |
69 |
}; |
81 |
}; |
70 |
|
82 |
|
71 |
- |
|
|