diff options
Diffstat (limited to 'spec/lib/gitlab/jira_import')
-rw-r--r-- | spec/lib/gitlab/jira_import/base_importer_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/jira_import/issues_importer_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/jira_import/labels_importer_spec.rb | 12 |
3 files changed, 10 insertions, 22 deletions
diff --git a/spec/lib/gitlab/jira_import/base_importer_spec.rb b/spec/lib/gitlab/jira_import/base_importer_spec.rb index 8bc43feb356..f22efcb8743 100644 --- a/spec/lib/gitlab/jira_import/base_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/base_importer_spec.rb @@ -37,12 +37,8 @@ describe Gitlab::JiraImport::BaseImporter do end context 'when import data exists' do - let(:jira_import_data) do - data = JiraImportData.new - data << JiraImportData::JiraProjectDetails.new('xx', Time.now.strftime('%Y-%m-%d %H:%M:%S'), { user_id: 1, name: 'root' }) - data - end - let(:project) { create(:project, import_data: jira_import_data) } + let_it_be(:project) { create(:project) } + let_it_be(:jira_import) { create(:jira_import_state, project: project) } let(:subject) { described_class.new(project) } context 'when #imported_items_cache_key is not implemented' do diff --git a/spec/lib/gitlab/jira_import/issues_importer_spec.rb b/spec/lib/gitlab/jira_import/issues_importer_spec.rb index 88e8b195dbe..8e16fd3e978 100644 --- a/spec/lib/gitlab/jira_import/issues_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/issues_importer_spec.rb @@ -3,14 +3,10 @@ require 'spec_helper' describe Gitlab::JiraImport::IssuesImporter do - let(:user) { create(:user) } - let(:jira_import_data) do - data = JiraImportData.new - data << JiraImportData::JiraProjectDetails.new('XX', Time.now.strftime('%Y-%m-%d %H:%M:%S'), { user_id: user.id, name: user.name }) - data - end - let(:project) { create(:project, import_data: jira_import_data) } - let!(:jira_service) { create(:jira_service, project: project) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project) } + let_it_be(:jira_import) { create(:jira_import_state, project: project) } + let_it_be(:jira_service) { create(:jira_service, project: project) } subject { described_class.new(project) } diff --git a/spec/lib/gitlab/jira_import/labels_importer_spec.rb b/spec/lib/gitlab/jira_import/labels_importer_spec.rb index eaa13d9ed32..2d0e2bc6b53 100644 --- a/spec/lib/gitlab/jira_import/labels_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/labels_importer_spec.rb @@ -3,14 +3,10 @@ require 'spec_helper' describe Gitlab::JiraImport::LabelsImporter do - let(:user) { create(:user) } - let(:jira_import_data) do - data = JiraImportData.new - data << JiraImportData::JiraProjectDetails.new('XX', Time.now.strftime('%Y-%m-%d %H:%M:%S'), { user_id: user.id, name: user.name }) - data - end - let(:project) { create(:project, import_data: jira_import_data) } - let!(:jira_service) { create(:jira_service, project: project) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project) } + let_it_be(:jira_import) { create(:jira_import_state, project: project) } + let_it_be(:jira_service) { create(:jira_service, project: project) } subject { described_class.new(project).execute } |