Maps repository users to Redmine users (#1383).
Users with same username or email are automatically mapped. Mapping can be manually adjusted in repository settings. Multiple usernames can be mapped to the same Redmine user. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2006 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -61,4 +61,38 @@ class RepositoriesControllerTest < Test::Unit::TestCase
|
||||
assert_response :success
|
||||
assert_equal 'image/svg+xml', @response.content_type
|
||||
end
|
||||
|
||||
def test_committers
|
||||
@request.session[:user_id] = 2
|
||||
# add a commit with an unknown user
|
||||
Changeset.create!(:repository => Project.find(1).repository, :committer => 'foo', :committed_on => Time.now, :revision => 100, :comments => 'Committed by foo.')
|
||||
|
||||
get :committers, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'committers'
|
||||
|
||||
assert_tag :td, :content => 'dlopper',
|
||||
:sibling => { :tag => 'td',
|
||||
:child => { :tag => 'select', :attributes => { :name => 'committers[dlopper]' },
|
||||
:child => { :tag => 'option', :content => 'Dave Lopper',
|
||||
:attributes => { :value => '3', :selected => 'selected' }}}}
|
||||
assert_tag :td, :content => 'foo',
|
||||
:sibling => { :tag => 'td',
|
||||
:child => { :tag => 'select', :attributes => { :name => 'committers[foo]' }}}
|
||||
assert_no_tag :td, :content => 'foo',
|
||||
:sibling => { :tag => 'td',
|
||||
:descendant => { :tag => 'option', :attributes => { :selected => 'selected' }}}
|
||||
end
|
||||
|
||||
def test_map_committers
|
||||
@request.session[:user_id] = 2
|
||||
# add a commit with an unknown user
|
||||
c = Changeset.create!(:repository => Project.find(1).repository, :committer => 'foo', :committed_on => Time.now, :revision => 100, :comments => 'Committed by foo.')
|
||||
|
||||
assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do
|
||||
post :committers, :id => 1, :committers => { 'foo' => '2', 'dlopper' => '3'}
|
||||
assert_redirected_to '/repositories/committers/ecookbook'
|
||||
assert_equal User.find(2), c.reload.user
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user