summaryrefslogtreecommitdiff
path: root/spec/services/user_project_access_changed_service_spec.rb
blob: 902ed723e0917436dd84cca3b01862a3a71b62f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe UserProjectAccessChangedService do
  describe '#execute' do
    it 'schedules the user IDs' do
      expect(AuthorizedProjectsWorker).to receive(:bulk_perform_and_wait)
        .with([[1], [2]])

      described_class.new([1, 2]).execute
    end

    it 'permits non-blocking operation' do
      expect(AuthorizedProjectsWorker).to receive(:bulk_perform_async)
        .with([[1], [2]])

      described_class.new([1, 2]).execute(blocking: false)
    end
  end
end