FIX: update flaky bulk invite spec (#17425)
This commit is contained in:
parent
dd62b88f78
commit
1f1ba07565
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue