diff options
Diffstat (limited to 'spec/services/notes/create_service_spec.rb')
-rw-r--r-- | spec/services/notes/create_service_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index 2f1c5a5b0f3..22606cc2461 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -18,6 +18,10 @@ RSpec.describe Notes::CreateService do end context "valid params" do + it_behaves_like 'does not trigger GraphQL subscription mergeRequestMergeStatusUpdated' do + let(:action) { note } + end + it 'returns a valid note' do expect(note).to be_valid end @@ -230,6 +234,10 @@ RSpec.describe Notes::CreateService do confidential: false) end + it_behaves_like 'triggers GraphQL subscription mergeRequestMergeStatusUpdated' do + let(:action) { described_class.new(project_with_repo, user, new_opts).execute } + end + it 'note is associated with a note diff file' do MergeRequests::MergeToRefService.new(project: merge_request.project, current_user: merge_request.author).execute(merge_request) @@ -248,6 +256,16 @@ RSpec.describe Notes::CreateService do end end + context 'when skip_merge_status_trigger execute option is set to true' do + it_behaves_like 'does not trigger GraphQL subscription mergeRequestMergeStatusUpdated' do + let(:action) do + described_class + .new(project_with_repo, user, new_opts) + .execute(skip_merge_status_trigger: true) + end + end + end + it 'does not track ipynb note usage data' do expect(::Gitlab::UsageDataCounters::IpynbDiffActivityCounter).not_to receive(:note_created) |