2024-07-09 02:14:28 +03:00
|
|
|
use gitbutler_reference::LocalRefname;
|
|
|
|
|
2024-05-07 20:37:28 +03:00
|
|
|
use super::*;
|
|
|
|
|
|
|
|
// Ensures that `verify_branch` returns an error when not on the integration branch.
|
2024-07-28 21:36:55 +03:00
|
|
|
#[test]
|
|
|
|
fn should_fail_on_incorrect_branch() {
|
2024-05-07 20:37:28 +03:00
|
|
|
let Test {
|
|
|
|
repository,
|
2024-07-04 16:26:10 +03:00
|
|
|
project,
|
2024-05-07 20:37:28 +03:00
|
|
|
controller,
|
|
|
|
..
|
|
|
|
} = &Test::default();
|
|
|
|
|
2024-07-09 02:14:28 +03:00
|
|
|
let branch_name: LocalRefname = "refs/heads/somebranch".parse().unwrap();
|
2024-05-07 20:37:28 +03:00
|
|
|
repository.checkout(&branch_name);
|
2024-07-28 21:36:55 +03:00
|
|
|
let result = controller.list_virtual_branches(project);
|
2024-05-07 20:37:28 +03:00
|
|
|
|
2024-05-31 11:03:22 +03:00
|
|
|
let err = result.unwrap_err();
|
|
|
|
assert_eq!(
|
|
|
|
format!("{err:#}"),
|
|
|
|
"<verification-failed>: project is on refs/heads/somebranch. Please checkout gitbutler/integration to continue"
|
|
|
|
);
|
2024-05-07 20:37:28 +03:00
|
|
|
}
|