-
Notifications
You must be signed in to change notification settings - Fork 26
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
AccountControllerTest#test_blocked_ips — Tried setting file times more explicitly so that this test works #962
Conversation
@@ -827,12 +827,20 @@ def test_blocked_ips | |||
get(:blocked_ips, add_bad: "garbage") | |||
assert_flash_error | |||
|
|||
time = 1.minute.ago | |||
File.utime(time.to_time, time.to_time, MO.blocked_ips_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use to_time
on Date objects, because they know nothing about the time zone in use.
@@ -827,12 +827,20 @@ def test_blocked_ips | |||
get(:blocked_ips, add_bad: "garbage") | |||
assert_flash_error | |||
|
|||
time = 1.minute.ago | |||
File.utime(time.to_time, time.to_time, MO.blocked_ips_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use to_time
on Date objects, because they know nothing about the time zone in use.
assert_true(IpStats.blocked?(new_ip)) | ||
|
||
time = 1.minute.ago | ||
File.utime(time.to_time, time.to_time, MO.blocked_ips_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use to_time
on Date objects, because they know nothing about the time zone in use.
assert_true(IpStats.blocked?(new_ip)) | ||
|
||
time = 1.minute.ago | ||
File.utime(time.to_time, time.to_time, MO.blocked_ips_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use to_time
on Date objects, because they know nothing about the time zone in use.
The rubocop |
This fixes it for me. THANK YOU @pellaea ! |
Added a tweak to match expectation format of calls to
(Other calls to |
Codeclimate checks should clear if #960 merges first (see note above) |
Code Climate has analyzed commit 846dcc6 and detected 0 issues on this pull request. View more on Code Climate. |
Jason: Thanks for fixing this. Works like a charm. I was getting so tired
of seeing that test fail.
As Nimmo suggested, Codeclimate is happy with
AccountControllerTest#test_blocked_ips...#962 now that #960 is merged.
I will merge it.
…On Sun, May 29, 2022 at 5:43 PM andrew nimmo ***@***.***> wrote:
Codeclimate checks should clear if #960
<#960> merges
first (see note above)
—
Reply to this email directly, view it on GitHub
<#962 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALDFGO47QYWUMGVOANGM3VMQFMLANCNFSM5XIUUVRQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
on all systems.