@@ -403,55 +403,55 @@ mod tests {
403403 fn test_string_question ( ) {
404404 let q = QuestionSpec :: new ( "Please, enter a username" , "username" )
405405 . as_string ( )
406- . with_actions ( & [ ( "next" , " Next") , ( "cancel" , "Cancel" ) ] ) ;
406+ . with_action_ids ( & [ gettext_noop ( " Next") , gettext_noop ( "Cancel" ) ] ) ;
407407
408408 let q_str = serde_json:: to_string_pretty ( & q) . unwrap ( ) ;
409409 println ! ( "{}" , & q_str) ;
410410 assert ! ( matches!( q. field, QuestionField :: String ) ) ;
411- assert_eq ! ( q. actions[ 0 ] , Action :: new( "next " , "Next" ) ) ;
412- assert_eq ! ( q. actions[ 1 ] , Action :: new( "cancel " , "Cancel" ) ) ;
411+ assert_eq ! ( q. actions[ 0 ] , Action :: new( "Next " , "Next" ) ) ;
412+ assert_eq ! ( q. actions[ 1 ] , Action :: new( "Cancel " , "Cancel" ) ) ;
413413 }
414414
415415 #[ test]
416416 fn test_password_question ( ) {
417417 let q = QuestionSpec :: new ( "Decrypt the device" , "luks" )
418418 . as_password ( )
419- . with_actions ( & [ ( "decrypt" , " Decrypt") , ( "skip" , "Skip" ) ] ) ;
419+ . with_action_ids ( & [ gettext_noop ( " Decrypt") , gettext_noop ( "Skip" ) ] ) ;
420420
421421 let q_str = serde_json:: to_string_pretty ( & q) . unwrap ( ) ;
422422 println ! ( "{}" , & q_str) ;
423423 assert ! ( matches!( q. field, QuestionField :: Password ) ) ;
424- assert_eq ! ( q. actions[ 0 ] , Action :: new( "decrypt " , "Decrypt" ) ) ;
425- assert_eq ! ( q. actions[ 1 ] , Action :: new( "skip " , "Skip" ) ) ;
424+ assert_eq ! ( q. actions[ 0 ] , Action :: new( "Decrypt " , "Decrypt" ) ) ;
425+ assert_eq ! ( q. actions[ 1 ] , Action :: new( "Skip " , "Skip" ) ) ;
426426 }
427427
428428 #[ test]
429429 fn test_select_question ( ) {
430430 let q = QuestionSpec :: new ( "There is a solver conflict..." , "conflict" )
431431 . as_select ( & [ ( "opt1" , "Option 1" ) , ( "opt2" , "Option 2" ) ] )
432- . with_actions ( & [ ( "decrypt" , " Decrypt") , ( "skip" , "Skip" ) ] ) ;
432+ . with_action_ids ( & [ gettext_noop ( " Decrypt") , gettext_noop ( "Skip" ) ] ) ;
433433
434434 let q_str = serde_json:: to_string_pretty ( & q) . unwrap ( ) ;
435435 println ! ( "{}" , & q_str) ;
436436 assert ! ( matches!(
437437 q. field,
438438 QuestionField :: Select { options: _options }
439439 ) ) ;
440- assert_eq ! ( q. actions[ 0 ] , Action :: new( "decrypt " , "Decrypt" ) ) ;
441- assert_eq ! ( q. actions[ 1 ] , Action :: new( "skip " , "Skip" ) ) ;
440+ assert_eq ! ( q. actions[ 0 ] , Action :: new( "Decrypt " , "Decrypt" ) ) ;
441+ assert_eq ! ( q. actions[ 1 ] , Action :: new( "Skip " , "Skip" ) ) ;
442442 }
443443
444444 #[ test]
445445 fn test_answers_to ( ) {
446446 let answer = Answer {
447- action : "cancel " . to_string ( ) ,
447+ action : "Cancel " . to_string ( ) ,
448448 value : None ,
449449 } ;
450450
451451 let q = QuestionSpec :: new ( "Please, enter a username" , "username" )
452452 . as_string ( )
453453 . with_data ( & [ ( "id" , "1" ) ] )
454- . with_actions ( & [ ( "next" , " Next") , ( "cancel" , "Cancel" ) ] ) ;
454+ . with_action_ids ( & [ gettext_noop ( " Next") , gettext_noop ( "Cancel" ) ] ) ;
455455
456456 let rule_by_text = AnswerRule {
457457 text : Some ( "Please, enter a username" . to_string ( ) ) ,
0 commit comments