mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-21 16:41:32 +03:00
7d078de52f
We want to move towards having each functional domain in a separate crate. The main benefit of that for our project is that this will enforce a unidirectional dependency graph (i.e. no cycles). Starting off with virutal_branches - a lot of the implementation is still in core (i.e. virtual.rs), that will be moved in a separate PR. Furthermore, the virtual branches controller (as well as virtual.rs) contain functions not directly related to branches (e.g. commit reordering etc). That will be furthe separate in a crate.
23 lines
667 B
Rust
23 lines
667 B
Rust
use super::*;
|
|
|
|
// Ensures that `verify_branch` returns an error when not on the integration branch.
|
|
#[tokio::test]
|
|
async fn should_fail_on_incorrect_branch() {
|
|
let Test {
|
|
repository,
|
|
project,
|
|
controller,
|
|
..
|
|
} = &Test::default();
|
|
|
|
let branch_name: git::LocalRefname = "refs/heads/somebranch".parse().unwrap();
|
|
repository.checkout(&branch_name);
|
|
let result = controller.list_virtual_branches(project).await;
|
|
|
|
let err = result.unwrap_err();
|
|
assert_eq!(
|
|
format!("{err:#}"),
|
|
"<verification-failed>: project is on refs/heads/somebranch. Please checkout gitbutler/integration to continue"
|
|
);
|
|
}
|