blob: 9a543dd00d42db3c54ed5effaeb0ea797c5c4f73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
shared_examples 'project import rate limiter' do
let(:user) { create(:user) }
before do
sign_in(user)
end
context 'when limit exceeds' do
before do
allow(Gitlab::ApplicationRateLimiter).to receive(:throttled?).and_return(true)
end
it 'notifies and redirects user' do
post :create, params: {}
expect(flash[:alert]).to eq('This endpoint has been requested too many times. Try again later.')
expect(response).to have_gitlab_http_status(:found)
end
end
end
|