Skip to content

The API allows adding tags with empty labels (names) and duplicate tags #289

@josecelano

Description

@josecelano

image

Check these tests:

#[tokio::test]
async fn it_should_allow_adding_duplicated_tags() {
    // code-review: is this an intended behavior?

    let mut env = TestEnv::new();
    env.start(api::Version::V1).await;

    // Add a tag
    let random_tag_name = random_tag_name();
    let response = add_tag(&random_tag_name, &env).await;
    assert_eq!(response.status, 200);

    // Try to add the same tag again
    let response = add_tag(&random_tag_name, &env).await;
    assert_eq!(response.status, 200);
}

#[tokio::test]
async fn it_should_allow_adding_a_tag_with_an_empty_name() {
    // code-review: is this an intended behavior?

    let mut env = TestEnv::new();
    env.start(api::Version::V1).await;

    let empty_tag_name = String::new();
    let response = add_tag(&empty_tag_name, &env).await;
    assert_eq!(response.status, 200);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIncorrect BehaviorEasyGood for Newcomers

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions