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