houndci fixes

This commit is contained in:
Stella Rouzi 2014-06-18 18:59:01 +03:00
parent 0beed70d7f
commit 44a95d9ced
2 changed files with 50 additions and 46 deletions

View file

@ -3,8 +3,8 @@ Osem::Application.routes.draw do
get 'conference/show'
devise_for :users, controllers: { registrations: :registrations,
omniauth_callbacks: 'users/omniauth_callbacks' },
path: 'accounts'
omniauth_callbacks: 'users/omniauth_callbacks' },
path: 'accounts'
namespace :admin do
resources :users

View file

@ -3,62 +3,66 @@ module OmniauthMacros
# authentication hashes to return during integration testing.
def mock_auth_new_user
OmniAuth.config.mock_auth[:google] = OmniAuth::AuthHash.new({
provider: 'google',
uid: 'google-test-uid-1',
info: {
email: 'test-1@gmail.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
})
OmniAuth.config.mock_auth[:google] =
OmniAuth::AuthHash.new(
provider: 'google',
uid: 'google-test-uid-1',
info: {
email: 'test-1@gmail.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
)
end
def mock_auth_new_user_fb
OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({
provider: 'google',
uid: 'facebook-test-uid-1',
info: {
email: 'test-1@gmail.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
})
OmniAuth.config.mock_auth[:facebook] =
OmniAuth::AuthHash.new(
provider: 'google',
uid: 'facebook-test-uid-1',
info: {
email: 'test-1@gmail.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
)
end
def mock_auth_existing_user_participant
# The mock_auth configuration allows you to set per-provider (or default)
# authentication hashes to return during integration testing.
OmniAuth.config.mock_auth[:google] = OmniAuth::AuthHash.new({
provider: 'google',
uid: 'google-test-uid-participant-1',
info: {
email: 'test-participant-1@google.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
})
OmniAuth.config.mock_auth[:google] =
OmniAuth::AuthHash.new(
provider: 'google',
uid: 'google-test-uid-participant-1',
info: {
email: 'test-participant-1@google.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
)
end
def mock_auth_existing_user_admin
# The mock_auth configuration allows you to set per-provider (or default)
# authentication hashes to return during integration testing.
OmniAuth.config.mock_auth[:google] = OmniAuth::AuthHash.new({
provider: 'google',
uid: 'google-test-uid-admin-1',
info: {
email: 'test-admin-1@google.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
})
OmniAuth.config.mock_auth[:google] =
OmniAuth::AuthHash.new(
provider: 'google',
uid: 'google-test-uid-admin-1',
info: {
email: 'test-admin-1@google.com'
},
credentials: {
token: 'mock_token',
secret: 'mock_secret'
}
)
end
end