##// END OF EJS Templates
Version sharing (#465) + optional inclusion of subprojects in the roadmap view (#2666)....
Version sharing (#465) + optional inclusion of subprojects in the roadmap view (#2666). Each version of a project can be shared with: * subprojects * projects in the project hierarchy: ancestors + descendants (needs versions management permission on the root project) * projects in the project tree: root project + all its descendants (same as above) * all projects (can be set by admin users only) Notes: * when sharing a version of a private project with others projects, its name will be visible within the other projects * a project with versions used by non descendant projects can not be archived git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3123 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2383:48e26aa75b41
r3009:5f8e9d711820
Show More
open_id_authentication_mock.rb
45 lines | 1.8 KiB | text/x-ruby | RubyLexer
/ test / mocks / open_id_authentication_mock.rb
# Mocks out OpenID
#
# http://www.northpub.com/articles/2007/04/02/testing-openid-support
module OpenIdAuthentication
EXTENSION_FIELDS = {'email' => 'user@somedomain.com',
'nickname' => 'cool_user',
'country' => 'US',
'postcode' => '12345',
'fullname' => 'Cool User',
'dob' => '1970-04-01',
'language' => 'en',
'timezone' => 'America/New_York'}
protected
def authenticate_with_open_id(identity_url = params[:openid_url], options = {}) #:doc:
if User.find_by_identity_url(identity_url) || identity_url.include?('good')
# Don't process registration fields unless it is requested.
unless identity_url.include?('blank') || (options[:required].nil? && options[:optional].nil?)
extension_response_fields = {}
options[:required].each do |field|
extension_response_fields[field.to_s] = EXTENSION_FIELDS[field.to_s]
end unless options[:required].nil?
options[:optional].each do |field|
extension_response_fields[field.to_s] = EXTENSION_FIELDS[field.to_s]
end unless options[:optional].nil?
end
yield Result[:successful], identity_url , extension_response_fields
else
logger.info "OpenID authentication failed: #{identity_url}"
yield Result[:failed], identity_url, nil
end
end
private
def add_simple_registration_fields(open_id_response, fields)
open_id_response.add_extension_arg('sreg', 'required', [ fields[:required] ].flatten * ',') if fields[:required]
open_id_response.add_extension_arg('sreg', 'optional', [ fields[:optional] ].flatten * ',') if fields[:optional]
end
end