FIX: update flaky bulk invite spec (#17425)

This commit is contained in:
Isaac Janzen 2022-07-11 11:58:23 -05:00 committed by GitHub
parent dd62b88f78
commit 1f1ba07565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1052,12 +1052,16 @@ describe InvitesController do
end
it 'errors if admins try to exceed limit of one bulk invite per day' do
RateLimiter.enable
sign_in(admin)
RateLimiter.enable
RateLimiter.clear_all!
start = Time.now
freeze_time(start)
post '/invites/reinvite-all'
expect(response.status).to eq(200)
expect(response.parsed_body['errors']).to_not be_present
freeze_time(start + 10.minutes)
post '/invites/reinvite-all'
expect(response.parsed_body['errors'][0]).to eq(I18n.t("rate_limiter.slow_down"))
end