Skip to content

Commit

Permalink
Fixed false positive test for failed attempt checking in authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
benjih authored and mogronalol committed Apr 27, 2017
1 parent 7ed578b commit a2e7751
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/authentication/auth_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ func Test_HasReachFailedAttemptsLimit_ReturnsFalseIfAttemptsIsBelowOrEqualToLimi
Expect(authentication.HasReachedFailedAttemptsLimit(3, "10s")).To(BeFalse())
}

func Test_HasReachFailedAttemptsLimit_ReturnsTrueIfAttemptsIsAboveLimit(t *testing.T) {
func Test_HasReachFailedAttemptsLimit_ReturnsTrueIfAttemptsIsAboveLimit_AndLastFailedIsWithinTheTimeoutPeriod(t *testing.T) {
RegisterTestingT(t)

authentication.Attempts.Count = 4
Expect(authentication.HasReachedFailedAttemptsLimit(3, "10s")).To(BeFalse())
authentication.Attempts.LastFailed = time.Now()
Expect(authentication.HasReachedFailedAttemptsLimit(3, "10s")).To(BeTrue())
}

func Test_HasReachFailedAttemptsLimit_IncreasesCountIfAttemptsIsAboveLimit_AndLastFailedIsWithinTheTimeoutPeriod(t *testing.T) {
Expand Down

0 comments on commit a2e7751

Please sign in to comment.