blob: 6931a7a953d12e19796ecc81b986b6369a3b9d3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Import::SetAsyncJid do
describe '.set_jid', :clean_gitlab_redis_shared_state do
let(:project) { create(:project, :import_scheduled) }
it 'sets the JID in Redis' do
expect(Gitlab::SidekiqStatus)
.to receive(:set)
.with("async-import/project-import-state/#{project.id}", Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION)
.and_call_original
described_class.set_jid(project.import_state)
end
it 'updates the import JID of the project' do
described_class.set_jid(project.import_state)
expect(project.import_state.reload.jid).to eq("async-import/project-import-state/#{project.id}")
end
end
end
|