story-kit: merge 77_bug_create_bug_file_writes_no_yaml_front_matter
This commit is contained in:
@@ -238,6 +238,10 @@ pub fn create_bug_file(
|
||||
.to_string();
|
||||
|
||||
let mut content = String::new();
|
||||
content.push_str("---\n");
|
||||
content.push_str(&format!("name: \"{}\"\n", name.replace('"', "\\\"")));
|
||||
content.push_str("test_plan: pending\n");
|
||||
content.push_str("---\n\n");
|
||||
content.push_str(&format!("# Bug {bug_number}: {name}\n\n"));
|
||||
content.push_str("## Description\n\n");
|
||||
content.push_str(description);
|
||||
@@ -1266,6 +1270,10 @@ mod tests {
|
||||
.join(".story_kit/work/1_upcoming/1_bug_login_crash.md");
|
||||
assert!(filepath.exists());
|
||||
let contents = fs::read_to_string(&filepath).unwrap();
|
||||
assert!(
|
||||
contents.starts_with("---\nname: \"Login Crash\"\ntest_plan: pending\n---"),
|
||||
"bug file must start with YAML front matter"
|
||||
);
|
||||
assert!(contents.contains("# Bug 1: Login Crash"));
|
||||
assert!(contents.contains("## Description"));
|
||||
assert!(contents.contains("The login page crashes on submit."));
|
||||
@@ -1305,6 +1313,10 @@ mod tests {
|
||||
|
||||
let filepath = tmp.path().join(".story_kit/work/1_upcoming/1_bug_some_bug.md");
|
||||
let contents = fs::read_to_string(&filepath).unwrap();
|
||||
assert!(
|
||||
contents.starts_with("---\nname: \"Some Bug\"\ntest_plan: pending\n---"),
|
||||
"bug file must have YAML front matter"
|
||||
);
|
||||
assert!(contents.contains("- [ ] Bug is fixed and verified"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user