gitbutler/crates/gitbutler-branch-actions/tests/virtual_branches/verify_branch.rs
Kiril Videlov c8658b9a23
rename gitbutler-virtual to gitbutler-branch-actions
This is to establish a patter of which crates represent a higher level logic
2024-07-10 14:49:48 +02:00

25 lines
702 B
Rust

use gitbutler_reference::LocalRefname;
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: 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"
);
}