summaryrefslogtreecommitdiff
path: root/spec/graphql/graphql_triggers_spec.rb
blob: 0b53c633077042eb48dc124c124f26c529b5cc52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe GraphqlTriggers do
  describe '.issuable_assignees_updated' do
    it 'triggers the issuableAssigneesUpdated subscription' do
      assignees = create_list(:user, 2)
      issue = create(:issue, assignees: assignees)

      expect(GitlabSchema.subscriptions).to receive(:trigger).with(
        'issuableAssigneesUpdated',
        { issuable_id: issue.to_gid },
        issue
      )

      GraphqlTriggers.issuable_assignees_updated(issue)
    end
  end
end