Revision 61c2f4a0
Von Kivitendo Admin vor fast 2 Jahren hinzugefügt
t/model/records.t | ||
---|---|---|
228 | 228 |
note " testing from quotation -> $target_record_type"; |
229 | 229 |
my $new_record = SL::Model::Record->new_from_workflow($sales_quotation1, $target_record_type); |
230 | 230 |
|
231 |
$new_record->save->load; |
|
231 |
SL::Model::Record->save($new_record); |
|
232 |
$new_record->load; |
|
232 | 233 |
cmp_ok($new_record->netamount, '==', 710, "converted $target_record_type netamount ok") if $new_record->can('netamount'); |
234 |
my $record_history = SL::DB::Manager::History->find_by(trans_id => $new_record->id, addition => 'SAVED'); |
|
235 |
ok($record_history->snumbers =~ m/_/, "history snumbers of record " . $record_history->snumbers . " ok"); |
|
233 | 236 |
test_record_links($new_record, "converted $target_record_type"); |
234 | 237 |
}; |
235 | 238 |
|
... | ... | |
241 | 244 |
if ( 'SL::DB::Reclamation' eq ref($new_record) ) { |
242 | 245 |
map { $_->reason($reclamation_reason) } @{ $new_record->items }; |
243 | 246 |
}; |
244 |
$new_record->save->load; |
|
247 |
SL::Model::Record->save($new_record); |
|
248 |
$new_record->load; |
|
249 |
my $record_history = SL::DB::Manager::History->find_by(trans_id => $new_record->id, what_done => $target_record_type, addition => 'SAVED'); |
|
250 |
|
|
251 |
ok($record_history->snumbers =~ m/_/, "history snumbers of record " . $record_history->snumbers . " ok"); |
|
252 |
|
|
245 | 253 |
cmp_ok($new_record->netamount, '==', 710, "converted $target_record_type netamount ok") if $new_record->can('netamount'); |
246 | 254 |
test_record_links($new_record, "converted $target_record_type"); |
247 | 255 |
}; |
Auch abrufbar als: Unified diff
t/model/records.t - new_from_workflow Test erweitert