Cleanup omniauth specs

This commit is contained in:
Michael Ball 2021-02-23 19:49:34 -08:00
parent 2573dbee44
commit e0fd14e0ce
4 changed files with 30 additions and 10 deletions

View file

@ -2,7 +2,7 @@
require 'spec_helper'
feature Openid do
feature Openid, type: :feature, js: true do
shared_examples 'sign in with openid' do
scenario 'has option to log in with Google account' do

View file

@ -6,12 +6,16 @@ module OmniauthMacros
ENV['OSEM_GOOGLE_KEY'] = 'test key google'
ENV['OSEM_GOOGLE_SECRET'] = 'test secret google'
# ENV['OSEM_FACEBOOK_KEY'] = 'test key facebook'
# ENV['OSEM_FACEBOOK_SECRET'] = 'test secret facebook'
# ENV['OSEM_SUSE_KEY'] = 'test key suse'
# ENV['OSEM_SUSE_SECRET'] = 'test secret suse'
# ENV['OSEM_GITHUB_KEY'] = 'test key github'
# ENV['OSEM_GITHUB_SECRET'] = 'test secret github'
ENV['OSEM_FACEBOOK_KEY'] = 'test key facebook'
ENV['OSEM_FACEBOOK_SECRET'] = 'test secret facebook'
ENV['OSEM_SUSE_KEY'] = 'test key suse'
ENV['OSEM_SUSE_SECRET'] = 'test secret suse'
ENV['OSEM_GITHUB_KEY'] = 'test key github'
ENV['OSEM_GITHUB_SECRET'] = 'test secret github'
ENV['OSEM_DISCOURSE_KEY'] = 'test key discourse'
ENV['OSEM_DISCOURSE_SECRET'] = 'test secret discourse'
def mock_auth_new_user
OmniAuth.config.mock_auth[:google] =
@ -146,5 +150,20 @@ module OmniauthMacros
secret: 'github_mock_secret'
}
)
OmniAuth.config.mock_auth[:discourse] =
OmniAuth::AuthHash.new(
provider: 'discourse',
uid: 'discourse-test-uid-1',
info: {
name: 'discourse user',
email: 'user-discourse@example.com',
username: 'user_discourse'
},
credentials: {
token: 'discourse_mock_token',
secret: 'discourse_mock_secret'
}
)
end
end