()
| 1108 | |
| 1109 | #[test] |
| 1110 | fn test_signup_process_error() { |
| 1111 | let t = ClientTester::default(); |
| 1112 | t.get_service().borrow_mut().add_mock_signup( |
| 1113 | SignupRequest { |
| 1114 | username: "the-username".to_owned(), |
| 1115 | password: "theP4ssword".to_owned(), |
| 1116 | email: "some@example.com".to_owned(), |
| 1117 | promotional_email: false, |
| 1118 | }, |
| 1119 | Err(io::Error::new(io::ErrorKind::AlreadyExists, "Some error")), |
| 1120 | ); |
| 1121 | t.get_console().borrow_mut().set_interactive(true); |
| 1122 | |
| 1123 | let mut t = t |
| 1124 | .add_input_chars("the-username\n") |
| 1125 | .add_input_chars("theP4ssword\n") |
| 1126 | .add_input_chars("theP4ssword\n") |
| 1127 | .add_input_chars("some@example.com\n") |
| 1128 | .add_input_chars("\n") // Default promotional email answer. |
| 1129 | .add_input_chars("true\n"); // Confirmation. |
| 1130 | let mut c = t.run("SIGNUP".to_owned()); |
| 1131 | let output = flatten_output(c.take_captured_out()); |
| 1132 | c.expect_err("1:1: Some error").check(); |
| 1133 | |
| 1134 | assert!(output.contains("Username: the-username")); |
| 1135 | assert!(output.contains("Email address: some@example.com")); |
| 1136 | assert!(output.contains("Promotional email: no")); |
| 1137 | } |
| 1138 | } |
nothing calls this directly
no test coverage detected