diff options
Diffstat (limited to 'spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb')
-rw-r--r-- | spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb b/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb new file mode 100644 index 00000000000..b43519a3e5d --- /dev/null +++ b/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::JiraImport::Stage::ImportIssuesWorker do + let(:project) { create(:project) } + let(:worker) { described_class.new } + + describe 'modules' do + it_behaves_like 'include import workers modules' + end + + describe '#perform' do + context 'when feature flag enabled' do + before do + stub_feature_flags(jira_issue_import: false) + end + + it_behaves_like 'exit import not started' + end + + context 'when feature flag enabled' do + before do + stub_feature_flags(jira_issue_import: true) + end + + context 'when import did not start' do + let!(:import_state) { create(:import_state, project: project) } + + it_behaves_like 'exit import not started' + end + + context 'when import started' do + let!(:import_state) { create(:import_state, status: :started, project: project) } + + it_behaves_like 'advance to next stage', :attachments + end + end + end +end |