DEV: Clean up omniauth after mocking.

This commit is contained in:
Guo Xiang Tan 2018-05-28 15:12:54 +08:00
parent 2bafd2a355
commit 123a22e6d8

View File

@ -747,7 +747,10 @@ describe UsersController do
context 'authentication records for' do
let(:user) { Fabricate(:user) }
before do
OmniAuth.config.test_mode = true
OmniAuth.config.mock_auth[:twitter] = OmniAuth::AuthHash.new(
provider: 'twitter',
uid: '123545',
@ -762,6 +765,11 @@ describe UsersController do
get "/auth/twitter/callback.json"
end
after do
Rails.application.env_config["omniauth.auth"] = OmniAuth.config.mock_auth[:twitter] = nil
OmniAuth.config.test_mode = false
end
it 'should create twitter user info if required' do
post "/u.json", params: {
name: "Test Osama",