mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
FIX: update flaky bulk invite spec (#17425)
This commit is contained in:
@ -1052,12 +1052,16 @@ describe InvitesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'errors if admins try to exceed limit of one bulk invite per day' do
|
it 'errors if admins try to exceed limit of one bulk invite per day' do
|
||||||
RateLimiter.enable
|
|
||||||
sign_in(admin)
|
sign_in(admin)
|
||||||
|
RateLimiter.enable
|
||||||
|
RateLimiter.clear_all!
|
||||||
|
start = Time.now
|
||||||
|
|
||||||
|
freeze_time(start)
|
||||||
post '/invites/reinvite-all'
|
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'
|
post '/invites/reinvite-all'
|
||||||
expect(response.parsed_body['errors'][0]).to eq(I18n.t("rate_limiter.slow_down"))
|
expect(response.parsed_body['errors'][0]).to eq(I18n.t("rate_limiter.slow_down"))
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user