debian-mirror-gitlab/spec/workers/authorized_projects_worker_spec.rb
2019-07-07 11:18:12 +05:30

26 lines
561 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe AuthorizedProjectsWorker do
describe '#perform' do
let(:user) { create(:user) }
subject(:job) { described_class.new }
it "refreshes user's authorized projects" do
expect_any_instance_of(User).to receive(:refresh_authorized_projects)
job.perform(user.id)
end
context "when the user is not found" do
it "does nothing" do
expect_any_instance_of(User).not_to receive(:refresh_authorized_projects)
job.perform(-1)
end
end
end
end