huskies: merge 677_refactor_reject_promotion_to_current_coder_of_work_items_with_junk_only_acceptance_criteria
This commit is contained in:
@@ -71,6 +71,7 @@ pub fn create_spike_file(
|
||||
root: &Path,
|
||||
name: &str,
|
||||
description: Option<&str>,
|
||||
acceptance_criteria: &[String],
|
||||
) -> Result<String, String> {
|
||||
let spike_number = next_item_number(root)?;
|
||||
let slug = slugify_name(name);
|
||||
@@ -103,7 +104,15 @@ pub fn create_spike_file(
|
||||
content.push_str("## Findings\n\n");
|
||||
content.push_str("- TBD\n\n");
|
||||
content.push_str("## Recommendation\n\n");
|
||||
content.push_str("- TBD\n");
|
||||
content.push_str("- TBD\n\n");
|
||||
content.push_str("## Acceptance Criteria\n\n");
|
||||
if acceptance_criteria.is_empty() {
|
||||
content.push_str("- [ ] TBD\n");
|
||||
} else {
|
||||
for criterion in acceptance_criteria {
|
||||
content.push_str(&format!("- [ ] {criterion}\n"));
|
||||
}
|
||||
}
|
||||
|
||||
// Write to database content store and CRDT.
|
||||
write_story_content(root, &spike_id, "1_backlog", &content);
|
||||
@@ -511,7 +520,7 @@ mod tests {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
|
||||
let spike_id =
|
||||
create_spike_file(tmp.path(), "Filesystem Watcher Architecture", None).unwrap();
|
||||
create_spike_file(tmp.path(), "Filesystem Watcher Architecture", None, &[]).unwrap();
|
||||
|
||||
assert!(
|
||||
spike_id.ends_with("_spike_filesystem_watcher_architecture"),
|
||||
@@ -549,7 +558,7 @@ mod tests {
|
||||
let description = "What is the best approach for watching filesystem events?";
|
||||
|
||||
let spike_id =
|
||||
create_spike_file(tmp.path(), "FS Watcher Spike", Some(description)).unwrap();
|
||||
create_spike_file(tmp.path(), "FS Watcher Spike", Some(description), &[]).unwrap();
|
||||
|
||||
let contents = crate::db::read_content(&spike_id)
|
||||
.or_else(|| {
|
||||
@@ -565,7 +574,7 @@ mod tests {
|
||||
#[test]
|
||||
fn create_spike_file_uses_placeholder_when_no_description() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let spike_id = create_spike_file(tmp.path(), "My Spike", None).unwrap();
|
||||
let spike_id = create_spike_file(tmp.path(), "My Spike", None, &[]).unwrap();
|
||||
|
||||
let contents = crate::db::read_content(&spike_id)
|
||||
.or_else(|| {
|
||||
@@ -581,7 +590,7 @@ mod tests {
|
||||
#[test]
|
||||
fn create_spike_file_rejects_empty_name() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let result = create_spike_file(tmp.path(), "!!!", None);
|
||||
let result = create_spike_file(tmp.path(), "!!!", None, &[]);
|
||||
assert!(result.is_err());
|
||||
assert!(result.unwrap_err().contains("alphanumeric"));
|
||||
}
|
||||
@@ -590,7 +599,7 @@ mod tests {
|
||||
fn create_spike_file_with_special_chars_in_name_produces_valid_yaml() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let name = "Spike: compare \"fast\" vs slow encoders";
|
||||
let result = create_spike_file(tmp.path(), name, None);
|
||||
let result = create_spike_file(tmp.path(), name, None, &[]);
|
||||
assert!(result.is_ok(), "create_spike_file failed: {result:?}");
|
||||
|
||||
let spike_id = result.unwrap();
|
||||
@@ -616,7 +625,7 @@ mod tests {
|
||||
"---\nname: Existing\n---\n",
|
||||
);
|
||||
|
||||
let spike_id = create_spike_file(tmp.path(), "My Spike", None).unwrap();
|
||||
let spike_id = create_spike_file(tmp.path(), "My Spike", None, &[]).unwrap();
|
||||
assert!(
|
||||
spike_id.ends_with("_spike_my_spike"),
|
||||
"expected ID to end with _spike_my_spike, got: {spike_id}"
|
||||
|
||||
Reference in New Issue
Block a user