diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 21:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 21:08:59 +0300 |
commit | 8b0d3151ae81cef695647771d1781c535d6f6cf5 (patch) | |
tree | f58d72ada21f6f7598a1e9f69fc80cdbbae8f2b6 /spec/services | |
parent | ec9dd96cd876d8778bb757a1e1e0252a58fdcbbb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/work_items/update_service_spec.rb | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index f96fbf54f08..ea4e582b239 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -104,6 +104,10 @@ RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning expect(issue.issue_customer_relations_contacts.last.contact).to eq contact end + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_issue(opts) } + end + context 'when updating milestone' do before do update_issue({ milestone_id: nil }) diff --git a/spec/services/work_items/update_service_spec.rb b/spec/services/work_items/update_service_spec.rb index 6a56e1a72e6..30c16458353 100644 --- a/spec/services/work_items/update_service_spec.rb +++ b/spec/services/work_items/update_service_spec.rb @@ -81,6 +81,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do let(:user) { current_user } subject(:service_action) { update_work_item[:status] } end + + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end end context 'when title is not changed' do @@ -107,6 +111,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do update_work_item end + + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end end context 'when decription is changed' do @@ -117,6 +125,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do update_work_item end + + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end end context 'when decription is not changed' do @@ -219,6 +231,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do expect(work_item.description).to eq('changed') end + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end + context 'with mentions', :mailer, :sidekiq_might_not_need_inline do shared_examples 'creates the todo and sends email' do |attribute| it 'creates a todo and sends email' do @@ -298,6 +314,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do expect(work_item.work_item_children).to include(child_work_item) end + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end + context 'when child type is invalid' do let_it_be(:child_work_item) { create(:work_item, project: project) } @@ -344,6 +364,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do update_work_item end + + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end end context 'when milestone remains unchanged' do @@ -375,6 +399,10 @@ RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do update_work_item end + it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do + subject(:execute_service) { update_work_item } + end + it_behaves_like 'broadcasting issuable labels updates' do let(:issuable) { work_item } let(:label_a) { label1 } |