MCPcopy Create free account
hub / github.com/endbasic/endbasic / test_signup_ok_with_promotional_email

Function test_signup_ok_with_promotional_email

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

Source from the content-addressed store, hash-verified

1011
1012 #[test]
1013 fn test_signup_ok_with_promotional_email() {
1014 let t = ClientTester::default();
1015 t.get_service().borrow_mut().add_mock_signup(
1016 SignupRequest {
1017 username: "foobar".to_owned(),
1018 password: "AnotherPassword5".to_owned(),
1019 email: "other@example.com".to_owned(),
1020 promotional_email: true,
1021 },
1022 Ok(()),
1023 );
1024 t.get_console().borrow_mut().set_interactive(true);
1025
1026 let mut t = t
1027 .add_input_chars("foobar\n")
1028 .add_input_chars("AnotherPassword5\n")
1029 .add_input_chars("AnotherPassword5\n")
1030 .add_input_chars("other@example.com\n")
1031 .add_input_chars("yes\n") // Promotional email answer.
1032 .add_input_chars("y\n"); // Confirmation.
1033 let mut c = t.run("SIGNUP".to_owned());
1034 let output = flatten_output(c.take_captured_out());
1035 c.check();
1036
1037 assert!(output.contains("Username: foobar"));
1038 assert!(output.contains("Email address: other@example.com"));
1039 assert!(output.contains("Promotional email: yes"));
1040 }
1041
1042 #[test]
1043 fn test_signup_ok_retry_inputs() {

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