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')
-rw-r--r--spec/services/issues/close_service_spec.rb2
-rw-r--r--spec/services/issues/set_crm_contacts_service_spec.rb8
-rw-r--r--spec/services/issues/update_service_spec.rb11
3 files changed, 18 insertions, 3 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb
index dabbd4bfa84..009f68594d7 100644
--- a/spec/services/issues/close_service_spec.rb
+++ b/spec/services/issues/close_service_spec.rb
@@ -194,7 +194,7 @@ RSpec.describe Issues::CloseService, feature_category: :team_planning do
end
end
- context "closed by a merge request", :sidekiq_might_not_need_inline do
+ context "closed by a merge request" do
subject(:close_issue) do
perform_enqueued_jobs do
described_class.new(container: project, current_user: user).close_issue(issue, closed_via: closing_merge_request)
diff --git a/spec/services/issues/set_crm_contacts_service_spec.rb b/spec/services/issues/set_crm_contacts_service_spec.rb
index aa5dec20a13..7d709bbd9c8 100644
--- a/spec/services/issues/set_crm_contacts_service_spec.rb
+++ b/spec/services/issues/set_crm_contacts_service_spec.rb
@@ -106,6 +106,14 @@ RSpec.describe Issues::SetCrmContactsService, feature_category: :team_planning d
it_behaves_like 'setting contacts'
it_behaves_like 'adds system note', 1, 1
+
+ context 'with empty list' do
+ let(:params) { { replace_ids: [] } }
+ let(:expected_contacts) { [] }
+
+ it_behaves_like 'setting contacts'
+ it_behaves_like 'adds system note', 0, 2
+ end
end
context 'add' do
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb
index eb9fe2b4ed7..c4012e2a98f 100644
--- a/spec/services/issues/update_service_spec.rb
+++ b/spec/services/issues/update_service_spec.rb
@@ -14,6 +14,7 @@ RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning
let_it_be(:label3) { create(:label, title: 'c', project: project) }
let_it_be(:milestone) { create(:milestone, project: project) }
+ let(:container) { project }
let(:issue) do
create(
:issue,
@@ -49,7 +50,7 @@ RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning
end
def update_issue(opts)
- described_class.new(container: project, current_user: user, params: opts).execute(issue)
+ described_class.new(container: container, current_user: user, params: opts).execute(issue)
end
it_behaves_like 'issuable update service updating last_edited_at values' do
@@ -825,7 +826,7 @@ RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning
end
it 'updates updated_at' do
- expect(issue.reload.updated_at).to be > Time.current
+ expect(issue.reload.updated_at).to be_future
end
end
end
@@ -1006,6 +1007,12 @@ RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning
it_behaves_like 'keeps issuable labels sorted after update'
it_behaves_like 'broadcasting issuable labels updates'
+ context 'when the issue belongs directly to a group' do
+ let(:container) { group }
+
+ it_behaves_like 'updating issuable labels'
+ end
+
def update_issuable(update_params)
update_issue(update_params)
end