blob: d095138f6b773db477a5e02a66f8974a30fba1e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
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
|