()
| 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() { |
nothing calls this directly
no test coverage detected