diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 16:05:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 16:05:49 +0000 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /spec/lib/gitlab/phabricator_import/project_creator_spec.rb | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) | |
download | gitlab-ce-0f94cf6ca9d272d8e0fda4a7a597866cf3dc1fc0.tar.gz |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc4216-0-stable
Diffstat (limited to 'spec/lib/gitlab/phabricator_import/project_creator_spec.rb')
-rw-r--r-- | spec/lib/gitlab/phabricator_import/project_creator_spec.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/lib/gitlab/phabricator_import/project_creator_spec.rb b/spec/lib/gitlab/phabricator_import/project_creator_spec.rb deleted file mode 100644 index 016aa0abe4d..00000000000 --- a/spec/lib/gitlab/phabricator_import/project_creator_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -require 'spec_helper' - -RSpec.describe Gitlab::PhabricatorImport::ProjectCreator do - let(:user) { create(:user) } - let(:params) do - { path: 'new-phab-import', - phabricator_server_url: 'http://phab.example.com', - api_token: 'the-token' } - end - - subject(:creator) { described_class.new(user, params) } - - describe '#execute' do - it 'creates a project correctly and schedule an import', :sidekiq_might_not_need_inline do - expect_next_instance_of(Gitlab::PhabricatorImport::Importer) do |importer| - expect(importer).to receive(:execute) - end - - project = creator.execute - - expect(project).to be_persisted - expect(project).to be_import - expect(project.import_type).to eq('phabricator') - expect(project.import_data.credentials).to match(a_hash_including(api_token: 'the-token')) - expect(project.import_data.data).to match(a_hash_including('phabricator_url' => 'http://phab.example.com')) - expect(project.import_url).to eq(Project::UNKNOWN_IMPORT_URL) - expect(project.namespace).to eq(user.namespace) - end - - context 'when import params are missing' do - let(:params) do - { path: 'new-phab-import', - phabricator_server_url: 'http://phab.example.com', - api_token: '' } - end - - it 'returns nil' do - expect(creator.execute).to be_nil - end - end - - context 'when import params are invalid' do - let(:params) do - { path: 'new-phab-import', - namespace_id: '-1', - phabricator_server_url: 'http://phab.example.com', - api_token: 'the-token' } - end - - it 'returns an unpersisted project' do - project = creator.execute - - expect(project).not_to be_persisted - expect(project).not_to be_valid - end - end - end -end |