From e20818ecb8485a22e0e6d2341c79564bbca654aa Mon Sep 17 00:00:00 2001 From: Siddharth Asthana <siddharthasthana31@gmail.com> Date: Thu, 2 Dec 2021 01:20:49 +0530 Subject: [PATCH] Fix Style/OpenStructUse offenses in gitlab_controller_spec Changelog: other --- .rubocop_todo/style/open_struct_use.yml | 1 - spec/controllers/import/gitlab_controller_spec.rb | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.rubocop_todo/style/open_struct_use.yml b/.rubocop_todo/style/open_struct_use.yml index aa486f695627..d50278da557e 100644 --- a/.rubocop_todo/style/open_struct_use.yml +++ b/.rubocop_todo/style/open_struct_use.yml @@ -13,7 +13,6 @@ Style/OpenStructUse: - lib/gitlab/testing/request_inspector_middleware.rb - lib/mattermost/session.rb - spec/controllers/groups/clusters_controller_spec.rb - - spec/controllers/import/gitlab_controller_spec.rb - spec/controllers/projects/clusters_controller_spec.rb - spec/factories/go_module_versions.rb - spec/factories/wiki_pages.rb diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb index 826625ba9c34..f757b7c69cf6 100644 --- a/spec/controllers/import/gitlab_controller_spec.rb +++ b/spec/controllers/import/gitlab_controller_spec.rb @@ -33,15 +33,16 @@ def assign_session_token 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 -- GitLab