From 745cd8ab27480a3cf516a2684db2c4fd7cf2144c Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Wed, 29 Mar 2023 22:59:57 +0200 Subject: Check user group when creating shared repos --- tests/cli.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/cli.rs b/tests/cli.rs index a4b36a9..4f8de2f 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -161,6 +161,17 @@ fn can_init_a_new_shared_git_repo() -> Result<()> { Ok(()) } +#[test] +fn does_not_init_shared_repo_if_the_user_isnt_in_the_group() -> Result<()> { + let mut c = spawn_interactive_process()?; + let group = "not-a-real-group"; + let repo_name = "my-new-shared-repo"; + c.p.send_line(&format!("git-init --group {} {}", group, repo_name))?; + c.p.exp_string("Unknown group")?; + + Ok(()) +} + #[test] fn runs_a_single_command_and_exit_with_cli_flag() -> Result<()> { let username = get_username().unwrap(); -- cgit v1.2.3