Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/issues/create_service_spec.rb')
-rw-r--r--spec/services/issues/create_service_spec.rb24
1 files changed, 9 insertions, 15 deletions
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb
index 3ea447b2384..57fcdf84163 100644
--- a/spec/services/issues/create_service_spec.rb
+++ b/spec/services/issues/create_service_spec.rb
@@ -302,7 +302,7 @@ RSpec.describe Issues::CreateService do
described_class.new(project: project, current_user: user, params: opts, spam_params: spam_params).execute
end
- context 'when rate limiting is in effect', :clean_gitlab_redis_cache do
+ context 'when rate limiting is in effect', :freeze_time, :clean_gitlab_redis_rate_limiting do
let(:user) { create(:user) }
before do
@@ -316,20 +316,16 @@ RSpec.describe Issues::CreateService do
context 'when too many requests are sent by one user' do
it 'raises an error' do
- freeze_time do
- expect do
- subject
- end.to raise_error(RateLimitedService::RateLimitedError)
- end
+ expect do
+ subject
+ end.to raise_error(RateLimitedService::RateLimitedError)
end
it 'creates 1 issue' do
- freeze_time do
- expect do
- subject
- rescue RateLimitedService::RateLimitedError
- end.to change { Issue.count }.by(1)
- end
+ expect do
+ subject
+ rescue RateLimitedService::RateLimitedError
+ end.to change { Issue.count }.by(1)
end
end
@@ -339,9 +335,7 @@ RSpec.describe Issues::CreateService do
end
it 'creates 2 issues' do
- freeze_time do
- expect { subject }.to change { Issue.count }.by(2)
- end
+ expect { subject }.to change { Issue.count }.by(2)
end
end
end