use super::{asked, said};
use crate::verbs::capability::{CALL, SCOPES};
use serde_json::json;
#[test]
fn an_answer_with_no_reach_typed_still_states_the_narrow_one() {
assert_eq!(
asked(&["answer", "home", "c-1", "pass"]),
json!({"op": "answer", "workspace": "home", "agent": "c-1",
"verdict": "pass", "scope": CALL})
);
}
#[test]
fn each_reach_rides_the_gesture_as_the_word_that_was_typed() {
for scope in SCOPES {
assert_eq!(
asked(&["answer", "home", "c-1", "refuse", scope])["scope"],
json!(scope)
);
}
}
#[test]
fn a_reach_that_is_none_of_the_three_refuses_here_and_names_them() {
let refusal = said(&["answer", "home", "c-1", "pass", "conversaton"]);
assert!(refusal.text.contains("conversaton"), "{}", refusal.text);
for scope in SCOPES {
assert!(
refusal.text.contains(scope),
"{scope} unnamed in {}",
refusal.text
);
}
assert_eq!(refusal.code, super::super::verdict::REFUSED);
}