diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/controllers/import | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/controllers/import')
-rw-r--r-- | spec/controllers/import/gitlab_controller_spec.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb index 826625ba9c3..117c934ad5d 100644 --- a/spec/controllers/import/gitlab_controller_spec.rb +++ b/spec/controllers/import/gitlab_controller_spec.rb @@ -30,18 +30,27 @@ RSpec.describe Import::GitlabController do expect(session[:gitlab_access_token]).to eq(token) expect(controller).to redirect_to(status_import_gitlab_url) end + + it "importable_repos should return an array" do + allow_next_instance_of(Gitlab::GitlabImport::Client) do |instance| + allow(instance).to receive(:projects).and_return([{ "id": 1 }].to_enum) + end + + expect(controller.send(:importable_repos)).to be_an_instance_of(Array) + end end describe "GET status" do + let(:repo_fake) { Struct.new(:id, :path, :path_with_namespace, :web_url, keyword_init: true) } + let(:repo) { repo_fake.new(id: 1, path: 'vim', path_with_namespace: 'asd/vim', web_url: 'https://gitlab.com/asd/vim') } + before do - @repo = OpenStruct.new(id: 1, path: 'vim', path_with_namespace: 'asd/vim', web_url: 'https://gitlab.com/asd/vim') assign_session_token end it_behaves_like 'import controller status' do - let(:repo) { @repo } - let(:repo_id) { @repo.id } - let(:import_source) { @repo.path_with_namespace } + let(:repo_id) { repo.id } + let(:import_source) { repo.path_with_namespace } let(:provider_name) { 'gitlab' } let(:client_repos_field) { :projects } end |