diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-12 12:07:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-12 12:07:33 +0000 |
commit | 784fae4b9d7e92350075df2a43d06893080ed1e6 (patch) | |
tree | c7a6fd444acd6897622b233b250a34fd176f01da /spec/services/merge_requests | |
parent | fc53ce8e6ca67bf217470179a1ea6cf139bcffad (diff) | |
download | gitlab-ce-784fae4b9d7e92350075df2a43d06893080ed1e6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/merge_requests')
3 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/merge_requests/get_urls_service_spec.rb b/spec/services/merge_requests/get_urls_service_spec.rb index 9e7a5260ca4..dcb8c8080a1 100644 --- a/spec/services/merge_requests/get_urls_service_spec.rb +++ b/spec/services/merge_requests/get_urls_service_spec.rb @@ -47,6 +47,7 @@ describe MergeRequests::GetUrlsService do context 'pushing to default branch' do let(:changes) { default_branch_changes } + it_behaves_like 'no_merge_request_url' end @@ -62,28 +63,33 @@ describe MergeRequests::GetUrlsService do context 'pushing one completely new branch' do let(:changes) { new_branch_changes } + it_behaves_like 'new_merge_request_link' end context 'pushing to existing branch but no merge request' do let(:changes) { existing_branch_changes } + it_behaves_like 'new_merge_request_link' end context 'pushing to deleted branch' do let(:changes) { deleted_branch_changes } + it_behaves_like 'no_merge_request_url' end context 'pushing to existing branch and merge request opened' do let!(:merge_request) { create(:merge_request, source_project: project, source_branch: source_branch) } let(:changes) { existing_branch_changes } + it_behaves_like 'show_merge_request_url' end context 'pushing to existing branch and merge request is reopened' do let!(:merge_request) { create(:merge_request, :opened, source_project: project, source_branch: source_branch) } let(:changes) { existing_branch_changes } + it_behaves_like 'show_merge_request_url' end @@ -105,12 +111,14 @@ describe MergeRequests::GetUrlsService do context 'pushing to existing branch and merge request is closed' do let!(:merge_request) { create(:merge_request, :closed, source_project: project, source_branch: source_branch) } let(:changes) { existing_branch_changes } + it_behaves_like 'new_merge_request_link' end context 'pushing to existing branch and merge request is merged' do let!(:merge_request) { create(:merge_request, :merged, source_project: project, source_branch: source_branch) } let(:changes) { existing_branch_changes } + it_behaves_like 'new_merge_request_link' end diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb index 9e69f179da9..1ba216e8ff1 100644 --- a/spec/services/merge_requests/refresh_service_spec.rb +++ b/spec/services/merge_requests/refresh_service_spec.rb @@ -608,6 +608,7 @@ describe MergeRequests::RefreshService do context 'marking the merge request as work in progress' do let(:refresh_service) { service.new(@project, @user) } + before do allow(refresh_service).to receive(:execute_hooks) end diff --git a/spec/services/merge_requests/resolved_discussion_notification_service_spec.rb b/spec/services/merge_requests/resolved_discussion_notification_service_spec.rb index dc2bd5bf3d0..29896db58ac 100644 --- a/spec/services/merge_requests/resolved_discussion_notification_service_spec.rb +++ b/spec/services/merge_requests/resolved_discussion_notification_service_spec.rb @@ -6,6 +6,7 @@ describe MergeRequests::ResolvedDiscussionNotificationService do let(:merge_request) { create(:merge_request) } let(:user) { create(:user) } let(:project) { merge_request.project } + subject { described_class.new(project, user) } describe "#execute" do |