MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_signup_ok

Function test_signup_ok

client/src/cmds.rs:983–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

981
982 #[test]
983 fn test_signup_ok() {
984 let t = ClientTester::default();
985 t.get_service().borrow_mut().add_mock_signup(
986 SignupRequest {
987 username: "the-username".to_owned(),
988 password: "theP4ssword".to_owned(),
989 email: "some@example.com".to_owned(),
990 promotional_email: false,
991 },
992 Ok(()),
993 );
994 t.get_console().borrow_mut().set_interactive(true);
995
996 let mut t = t
997 .add_input_chars("the-username\n")
998 .add_input_chars("theP4ssword\n")
999 .add_input_chars("theP4ssword\n")
1000 .add_input_chars("some@example.com\n")
1001 .add_input_chars("\n") // Default promotional email answer.
1002 .add_input_chars("y\n"); // Confirmation.
1003 let mut c = t.run("SIGNUP".to_owned());
1004 let output = flatten_output(c.take_captured_out());
1005 c.check();
1006
1007 assert!(output.contains("Username: the-username"));
1008 assert!(output.contains("Email address: some@example.com"));
1009 assert!(output.contains("Promotional email: no"));
1010 }
1011
1012 #[test]
1013 fn test_signup_ok_with_promotional_email() {

Callers

nothing calls this directly

Calls 9

flatten_outputFunction · 0.85
add_mock_signupMethod · 0.80
get_serviceMethod · 0.80
set_interactiveMethod · 0.80
get_consoleMethod · 0.45
add_input_charsMethod · 0.45
runMethod · 0.45
take_captured_outMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected