diff options
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 24 | ||||
-rw-r--r-- | spec/services/projects/destroy_service_spec.rb | 8 |
2 files changed, 17 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 diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb index 9bdd9800fcc..ac84614121a 100644 --- a/spec/services/projects/destroy_service_spec.rb +++ b/spec/services/projects/destroy_service_spec.rb @@ -331,6 +331,14 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do end end end + + context 'for an archived project' do + before do + project.update!(archived: true) + end + + it_behaves_like 'deleting the project with pipeline and build' + end end describe 'container registry' do |