I think it should be enough if you check that:

```
assert_equal "refs/heads/packed", repo.references["HEAD"].target_id
```

The other assertions you have in this test don't really have anything to do with the `:checkout_branch` option.