Make Omniauth providers specs to not modify global configuration

This commit is contained in:
Kamil Trzcinski 2016-06-08 16:49:01 +02:00
parent 722211cddf
commit 13d941e185
6 changed files with 12 additions and 5 deletions

View File

@ -36,6 +36,7 @@ v 8.9.0 (unreleased)
- Use downcased path to container repository as this is expected path by Docker
- Projects pending deletion will render a 404 page
- Measure queue duration between gitlab-workhorse and Rails
- Make Omniauth providers specs to not modify global configuration
- Make authentication service for Container Registry to be compatible with < Docker 1.11
- Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav

View File

@ -28,6 +28,6 @@ module ImportSpecHelper
app_id: 'asd123',
app_secret: 'asd123'
)
Gitlab.config.omniauth.providers << provider
allow(Gitlab.config.omniauth).to receive(:providers).and_return([provider])
end
end

View File

@ -1,12 +1,14 @@
require 'spec_helper'
describe Gitlab::BitbucketImport::Client, lib: true do
include ImportSpecHelper
let(:token) { '123456' }
let(:secret) { 'secret' }
let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) }
before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket")
stub_omniauth_provider('bitbucket')
end
it 'all OAuth client options are symbols' do

View File

@ -1,8 +1,10 @@
require 'spec_helper'
describe Gitlab::BitbucketImport::Importer, lib: true do
include ImportSpecHelper
before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket")
stub_omniauth_provider('bitbucket')
end
let(:statuses) do

View File

@ -1,11 +1,13 @@
require 'spec_helper'
describe Gitlab::GitlabImport::Client, lib: true do
include ImportSpecHelper
let(:token) { '123456' }
let(:client) { Gitlab::GitlabImport::Client.new(token) }
before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "gitlab")
stub_omniauth_provider('gitlab')
end
it 'all OAuth2 client options are symbols' do

View File

@ -124,7 +124,7 @@ describe Projects::ImportService, services: true do
}
)
Gitlab.config.omniauth.providers << provider
allow(Gitlab.config.omniauth).to receive(:providers).and_return([provider])
end
end
end