Commit 1e4db9ed authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'make-omniauth-tests-to-not-modify-global-state' into 'master'

Make Omniauth providers specs to not modify global configuration

See merge request !4534
parents 3d72cb89 a0adafdd
...@@ -39,6 +39,7 @@ v 8.9.0 (unreleased) ...@@ -39,6 +39,7 @@ v 8.9.0 (unreleased)
- Use downcased path to container repository as this is expected path by Docker - Use downcased path to container repository as this is expected path by Docker
- Projects pending deletion will render a 404 page - Projects pending deletion will render a 404 page
- Measure queue duration between gitlab-workhorse and Rails - 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 - 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) - Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav - Cache assigned issue and merge request counts in sidebar nav
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::BitbucketController do describe Import::BitbucketController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::FogbugzController do describe Import::FogbugzController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::GithubController do describe Import::GithubController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::GitlabController do describe Import::GitlabController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::GitoriousController do describe Import::GitoriousController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
require_relative 'import_spec_helper'
describe Import::GoogleCodeController do describe Import::GoogleCodeController do
include ImportSpecHelper include ImportSpecHelper
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::BitbucketImport::Client, lib: true do describe Gitlab::BitbucketImport::Client, lib: true do
include ImportSpecHelper
let(:token) { '123456' } let(:token) { '123456' }
let(:secret) { 'secret' } let(:secret) { 'secret' }
let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) } let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) }
before do before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket") stub_omniauth_provider('bitbucket')
end end
it 'all OAuth client options are symbols' do it 'all OAuth client options are symbols' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::BitbucketImport::Importer, lib: true do describe Gitlab::BitbucketImport::Importer, lib: true do
include ImportSpecHelper
before do before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket") stub_omniauth_provider('bitbucket')
end end
let(:statuses) do let(:statuses) do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitlabImport::Client, lib: true do describe Gitlab::GitlabImport::Client, lib: true do
include ImportSpecHelper
let(:token) { '123456' } let(:token) { '123456' }
let(:client) { Gitlab::GitlabImport::Client.new(token) } let(:client) { Gitlab::GitlabImport::Client.new(token) }
before do before do
Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "gitlab") stub_omniauth_provider('gitlab')
end end
it 'all OAuth2 client options are symbols' do it 'all OAuth2 client options are symbols' do
......
...@@ -124,7 +124,7 @@ def stub_github_omniauth_provider ...@@ -124,7 +124,7 @@ def stub_github_omniauth_provider
} }
) )
Gitlab.config.omniauth.providers << provider allow(Gitlab.config.omniauth).to receive(:providers).and_return([provider])
end end
end end
end end
...@@ -28,6 +28,6 @@ def stub_omniauth_provider(name) ...@@ -28,6 +28,6 @@ def stub_omniauth_provider(name)
app_id: 'asd123', app_id: 'asd123',
app_secret: 'asd123' app_secret: 'asd123'
) )
Gitlab.config.omniauth.providers << provider allow(Gitlab.config.omniauth).to receive(:providers).and_return([provider])
end end
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment