diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-27 15:07:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-27 15:07:43 +0300 |
commit | 39fa7d1eeb2dba52f0601128f3ac91f57d19866e (patch) | |
tree | da042d34ff762dd1957e51666a34202295a081b9 /spec/services | |
parent | 6ac4a6713ed3196af899011f7e18658e16ebaac0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
6 files changed, 7 insertions, 37 deletions
diff --git a/spec/services/merge_requests/after_create_service_spec.rb b/spec/services/merge_requests/after_create_service_spec.rb index 974f72fa376..4aefe5f7dae 100644 --- a/spec/services/merge_requests/after_create_service_spec.rb +++ b/spec/services/merge_requests/after_create_service_spec.rb @@ -53,19 +53,5 @@ describe MergeRequests::AfterCreateService do after_create_service.execute(merge_request) end - - # https://gitlab.com/gitlab-org/gitlab/issues/208813 - context 'when the create_merge_request_pipelines_in_sidekiq flag is disabled' do - before do - stub_feature_flags(create_merge_request_pipelines_in_sidekiq: false) - end - - it 'does not create a pipeline or update the HEAD pipeline' do - expect(after_create_service).not_to receive(:create_pipeline_for) - expect(merge_request).not_to receive(:update_head_pipeline) - - after_create_service.execute(merge_request) - end - end end end diff --git a/spec/services/merge_requests/create_service_spec.rb b/spec/services/merge_requests/create_service_spec.rb index 2514fda5053..dc34546a599 100644 --- a/spec/services/merge_requests/create_service_spec.rb +++ b/spec/services/merge_requests/create_service_spec.rb @@ -129,22 +129,6 @@ describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do end end - # https://gitlab.com/gitlab-org/gitlab/issues/208813 - context 'when the create_merge_request_pipelines_in_sidekiq flag is disabled' do - before do - stub_feature_flags(create_merge_request_pipelines_in_sidekiq: false) - end - - it 'creates a pipeline and updates the HEAD pipeline' do - expect(service).to receive(:create_pipeline_for) - expect_next_instance_of(MergeRequest) do |merge_request| - expect(merge_request).to receive(:update_head_pipeline) - end - - service.execute - end - end - context 'when head pipelines already exist for merge request source branch', :sidekiq_inline do let(:shas) { project.repository.commits(opts[:source_branch], limit: 2).map(&:id) } let!(:pipeline_1) { create(:ci_pipeline, project: project, ref: opts[:source_branch], project_id: project.id, sha: shas[1]) } diff --git a/spec/services/projects/group_links/create_service_spec.rb b/spec/services/projects/group_links/create_service_spec.rb index 6ded57f961c..92667184be8 100644 --- a/spec/services/projects/group_links/create_service_spec.rb +++ b/spec/services/projects/group_links/create_service_spec.rb @@ -27,6 +27,6 @@ describe Projects::GroupLinks::CreateService, '#execute' do end it 'returns error if user is not allowed to share with a group' do - expect { subject.execute(create :group) }.not_to change { project.project_group_links.count } + expect { subject.execute(create(:group)) }.not_to change { project.project_group_links.count } end end diff --git a/spec/services/releases/create_service_spec.rb b/spec/services/releases/create_service_spec.rb index b624b9475e3..255f044db90 100644 --- a/spec/services/releases/create_service_spec.rb +++ b/spec/services/releases/create_service_spec.rb @@ -160,7 +160,7 @@ describe Releases::CreateService do context 'when no milestone is passed in' do it 'creates a release without a milestone tied to it' do - expect(params.key? :milestones).to be_falsey + expect(params.key?(:milestones)).to be_falsey service.execute release = project.releases.last diff --git a/spec/services/spam/spam_check_service_spec.rb b/spec/services/spam/spam_check_service_spec.rb index 732b64b52a0..8ae6764c5d5 100644 --- a/spec/services/spam/spam_check_service_spec.rb +++ b/spec/services/spam/spam_check_service_spec.rb @@ -103,7 +103,7 @@ describe Spam::SpamCheckService do issue.description = 'SPAM!' end - context 'when indicated as spam by akismet' do + context 'when indicated as spam by Akismet' do before do allow(Spam::AkismetService).to receive(:new).and_return(double(spam?: true)) end @@ -115,7 +115,7 @@ describe Spam::SpamCheckService do it_behaves_like 'akismet spam' - it 'checks as spam' do + it 'marks as spam' do subject expect(issue.reload.spam).to be_truthy @@ -125,7 +125,7 @@ describe Spam::SpamCheckService do context 'when allow_possible_spam feature flag is true' do it_behaves_like 'akismet spam' - it 'does not check as spam' do + it 'does not mark as spam' do subject expect(issue.spam).to be_falsey @@ -133,7 +133,7 @@ describe Spam::SpamCheckService do end end - context 'when not indicated as spam by akismet' do + context 'when not indicated as spam by Akismet' do before do allow(Spam::AkismetService).to receive(:new).and_return(double(spam?: false)) end diff --git a/spec/services/wiki_pages/update_service_spec.rb b/spec/services/wiki_pages/update_service_spec.rb index 3eb486833e6..ece714ee8e5 100644 --- a/spec/services/wiki_pages/update_service_spec.rb +++ b/spec/services/wiki_pages/update_service_spec.rb @@ -94,7 +94,7 @@ describe WikiPages::UpdateService do end it 'reports the error' do - expect(service.execute page).to be_invalid + expect(service.execute(page)).to be_invalid .and have_attributes(errors: be_present) end end |