diff options
Diffstat (limited to 'spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb')
-rw-r--r-- | spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb b/spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb index 7d1c29614e4..956898c1abc 100644 --- a/spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb +++ b/spec/workers/gitlab/jira_import/stage/import_notes_worker_spec.rb @@ -3,34 +3,38 @@ require 'spec_helper' describe Gitlab::JiraImport::Stage::ImportNotesWorker do - let_it_be(:project) { create(:project) } + let_it_be(:project) { create(:project, import_type: 'jira') } describe 'modules' do it_behaves_like 'include import workers modules' end describe '#perform' do - context 'when feature flag enabled' do + context 'when feature flag disabled' do before do stub_feature_flags(jira_issue_import: false) end - it_behaves_like 'exit import not started' + it_behaves_like 'cannot do jira import' + it_behaves_like 'does not advance to next stage' end context 'when feature flag enabled' do + let_it_be(:jira_import) { create(:jira_import_state, :scheduled, project: project) } + 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' + it_behaves_like 'cannot do jira import' + it_behaves_like 'does not advance to next stage' end context 'when import started' do - let!(:import_state) { create(:import_state, status: :started, project: project) } + before do + jira_import.start! + end it_behaves_like 'advance to next stage', :finish end |