Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yammmt opened this issue Apr 29, 2020 · 1 comment
Open

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

yammmt opened this issue Apr 29, 2020 · 1 comment
Assignees
Labels
bug Something isn't working minor Minor issue: not critical

Comments

@yammmt
Copy link
Owner

yammmt commented Apr 29, 2020

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.

@yammmt yammmt added bug Something isn't working minor Minor issue: not critical labels Apr 29, 2020
@yammmt yammmt self-assigned this Apr 29, 2020
@yammmt
Copy link
Owner Author

yammmt commented Apr 25, 2021

The quanta crate (introduced by rust-jp Slack) seems to be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor Minor issue: not critical
Projects
None yet
Development

No branches or pull requests

1 participant