use crate::builders::PublishBuilder;
use crate::util::{RequestHelper, TestApp};
use insta::assert_snapshot;

#[tokio::test(flavor = "multi_thread")]
async fn new_krate_git_upload_with_conflicts() {
    let (app, _, _, token) = TestApp::full().with_git_index().with_token().await;

    app.upstream_index().create_empty_commit().unwrap();

    let crate_to_publish = PublishBuilder::new("foo_conflicts", "1.0.0");
    token.publish_crate(crate_to_publish).await.good();

    assert_snapshot!(app.stored_files().await.join("\n"), @"
    crates/foo_conflicts/foo_conflicts-1.0.0.crate
    crates/foo_conflicts/foo_conflicts-1.0.0.zip
    crates/foo_conflicts/foo_conflicts-1.0.0.zip.json
    index/fo/o_/foo_conflicts
    rss/crates.xml
    rss/crates/foo_conflicts.xml
    rss/updates.xml
    ");
}
