-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
allow only one confirmation #1001
allow only one confirmation #1001
Conversation
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.
Thank you for bringing this to a mergeable PR.
@@ -10,6 +10,10 @@ def show | |||
token_hash = BCrypt::Password.create(token) | |||
expiry = (Time.now + @resource.token_lifespan).to_i | |||
|
|||
if @resource.sign_in_count >0 |
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.
Perhaps a space after the operator?
8b9dfcd
to
89fccba
Compare
89fccba
to
929e889
Compare
This change means |
@hansy if this is concerning for you please file a new issue since this was already merged! Thanks |
|
||
test 'user already confirmed' do | ||
assert @resource.sign_in_count > 0 do | ||
assert expiry == (Time.now + Time.now + 1.second).to_i |
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.
The #assert
method from minitest does not yield the block that is given here!
(See RDoc for Minitest::Assertions#assert
)
To further demonstrate this, even with an exception raised from within the block, the test still passes!
test 'user already confirmed' do
assert @resource.sign_in_count > 0 do
assert expiry == (Time.now + Time.now + 1.second).to_i
raise "Chunky Bacon!"
end
end
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.
n/m... I commented here waaay late, and this has been resolved by #1113.
Reopened #519 because it has conflicts and the original author can't rebase it
Thanks @rmvenancio !