diff options
Diffstat (limited to 'spec/services/projects/import_service_spec.rb')
-rw-r--r-- | spec/services/projects/import_service_spec.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index ccfd119b55b..ab9f99f893d 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -199,12 +199,13 @@ RSpec.describe Projects::ImportService do context 'with valid importer' do before do - stub_github_omniauth_provider + provider = double(:provider).as_null_object + stub_omniauth_setting(providers: [provider]) project.import_url = 'https://github.com/vim/vim.git' project.import_type = 'github' - allow(project).to receive(:import_data).and_return(double.as_null_object) + allow(project).to receive(:import_data).and_return(double(:import_data).as_null_object) end it 'succeeds if importer succeeds' do @@ -296,22 +297,5 @@ RSpec.describe Projects::ImportService do subject.execute end end - - def stub_github_omniauth_provider - provider = ActiveSupport::InheritableOptions.new( - 'name' => 'github', - 'app_id' => 'asd123', - 'app_secret' => 'asd123', - 'args' => { - 'client_options' => { - 'site' => 'https://github.com/api/v3', - 'authorize_url' => 'https://github.com/login/oauth/authorize', - 'token_url' => 'https://github.com/login/oauth/access_token' - } - } - ) - - stub_omniauth_setting(providers: [provider]) - end end end |