Skip to content

Date update test fails if we run it between 23:59 and 00:00 #1

Description

@yammmt

Here, if date is changed between first line and client.post, this test fails.

last-date/src/tests.rs

Lines 258 to 268 in c25efc5

let today_str = Local::today().naive_local().to_string();
// First, ensure current task date is not today.
assert_ne!(new_tasks[0].updated_at, today_str);
let inserted_id = new_tasks[0].id.unwrap(); // `id` is `Nullable`
let res = client.post(format!("/{}/date", inserted_id)).dispatch();
let mut cookies = res.headers().get("Set-Cookie");
let final_tasks = Task::all(&conn);
assert_eq!(res.status(), Status::SeeOther);
assert!(cookies.any(|value| value.contains("success")));
assert_eq!(final_tasks[0].updated_at, today_str);

Apparently this is not critical issue, but, for example, GitHub Action could add ❌ to originally ✅ commit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingminorMinor issue: not critical

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions