| 87 | |
| 88 | #[test] |
| 89 | fn idempotency() { |
| 90 | let f = Fixtures::copy("simple"); |
| 91 | let actor = actor(); |
| 92 | |
| 93 | let repo_id = RepoId::other(); |
| 94 | git::core::Repo::ensure(&f.git.root, repo_id).unwrap(); |
| 95 | let path = f.git.root.repo_path(repo_id); |
| 96 | assert!(path.exists()); |
| 97 | |
| 98 | delete(&f, repo_id, &actor, &actor.user_id).unwrap(); |
| 99 | assert!(!path.exists()); |
| 100 | |
| 101 | let result = delete(&f, repo_id, &actor, &actor.user_id); |
| 102 | assert!(result.is_ok()); |
| 103 | assert!(!path.exists()); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | mod ensure_personal_repo { |