huskies: merge 1009
This commit is contained in:
@@ -12,7 +12,7 @@ pub fn stage_display_name(stage: &Stage) -> &'static str {
|
||||
match stage {
|
||||
Stage::Upcoming => "Upcoming",
|
||||
Stage::Backlog => "Backlog",
|
||||
Stage::Coding => "Current",
|
||||
Stage::Coding { .. } => "Current",
|
||||
Stage::Blocked { .. } => "Blocked",
|
||||
Stage::Qa => "QA",
|
||||
Stage::Merge { .. } => "Merge",
|
||||
@@ -253,7 +253,10 @@ mod tests {
|
||||
#[test]
|
||||
fn stage_display_name_maps_all_known_stages() {
|
||||
assert_eq!(stage_display_name(&Stage::Backlog), "Backlog");
|
||||
assert_eq!(stage_display_name(&Stage::Coding), "Current");
|
||||
assert_eq!(
|
||||
stage_display_name(&Stage::Coding { claim: None }),
|
||||
"Current"
|
||||
);
|
||||
assert_eq!(stage_display_name(&Stage::Qa), "QA");
|
||||
assert_eq!(stage_display_name(&merge_stage()), "Merge");
|
||||
assert_eq!(stage_display_name(&done_stage()), "Done");
|
||||
@@ -290,7 +293,7 @@ mod tests {
|
||||
"42_story_thing",
|
||||
"Some Story",
|
||||
&Stage::Backlog,
|
||||
&Stage::Coding,
|
||||
&Stage::Coding { claim: None },
|
||||
);
|
||||
assert!(!plain.contains("\u{1f389}"));
|
||||
}
|
||||
@@ -301,7 +304,7 @@ mod tests {
|
||||
"261_story_bot_notifications",
|
||||
"Bot notifications",
|
||||
&Stage::Upcoming,
|
||||
&Stage::Coding,
|
||||
&Stage::Coding { claim: None },
|
||||
);
|
||||
assert_eq!(
|
||||
plain,
|
||||
@@ -315,8 +318,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn format_stage_notification_without_story_name_falls_back_to_number() {
|
||||
let (plain, html) =
|
||||
format_stage_notification("42_bug_fix_thing", "", &Stage::Coding, &Stage::Qa);
|
||||
let (plain, html) = format_stage_notification(
|
||||
"42_bug_fix_thing",
|
||||
"",
|
||||
&Stage::Coding { claim: None },
|
||||
&Stage::Qa,
|
||||
);
|
||||
assert_eq!(plain, "#42 \u{2014} Current \u{2192} QA");
|
||||
assert_eq!(html, "<strong>#42</strong> \u{2014} Current \u{2192} QA");
|
||||
}
|
||||
@@ -334,15 +341,23 @@ mod tests {
|
||||
#[test]
|
||||
fn format_stage_notification_long_name_is_preserved() {
|
||||
let long_name = "A".repeat(300);
|
||||
let (plain, _html) =
|
||||
format_stage_notification("1_story_long", &long_name, &Stage::Coding, &Stage::Qa);
|
||||
let (plain, _html) = format_stage_notification(
|
||||
"1_story_long",
|
||||
&long_name,
|
||||
&Stage::Coding { claim: None },
|
||||
&Stage::Qa,
|
||||
);
|
||||
assert!(plain.contains(&long_name));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_stage_notification_empty_story_name_falls_back_to_number() {
|
||||
let (plain, html) =
|
||||
format_stage_notification("42_story_empty", "", &Stage::Coding, &Stage::Qa);
|
||||
let (plain, html) = format_stage_notification(
|
||||
"42_story_empty",
|
||||
"",
|
||||
&Stage::Coding { claim: None },
|
||||
&Stage::Qa,
|
||||
);
|
||||
assert_eq!(plain, "#42 \u{2014} Current \u{2192} QA");
|
||||
assert_eq!(html, "<strong>#42</strong> \u{2014} Current \u{2192} QA");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user