##// END OF EJS Templates
scm: code clean up unit repository test....
Toshi MARUYAMA -
r5538:c33be450e718
parent child
Show More
@@ -1,16 +1,16
1 # redMine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -41,7 +41,7 class RepositoryTest < ActiveSupport::TestCase
41 def test_create
41 def test_create
42 repository = Repository::Subversion.new(:project => Project.find(3))
42 repository = Repository::Subversion.new(:project => Project.find(3))
43 assert !repository.save
43 assert !repository.save
44
44
45 repository.url = "svn://localhost"
45 repository.url = "svn://localhost"
46 assert repository.save
46 assert repository.save
47 repository.reload
47 repository.reload
@@ -164,22 +164,22 class RepositoryTest < ActiveSupport::TestCase
164
164
165 def test_auto_user_mapping_by_username
165 def test_auto_user_mapping_by_username
166 c = Changeset.create!(
166 c = Changeset.create!(
167 :repository => @repository,
167 :repository => @repository,
168 :committer => 'jsmith',
168 :committer => 'jsmith',
169 :committed_on => Time.now,
169 :committed_on => Time.now,
170 :revision => 100,
170 :revision => 100,
171 :comments => 'Committed by john.'
171 :comments => 'Committed by john.'
172 )
172 )
173 assert_equal User.find(2), c.user
173 assert_equal User.find(2), c.user
174 end
174 end
175
175
176 def test_auto_user_mapping_by_email
176 def test_auto_user_mapping_by_email
177 c = Changeset.create!(
177 c = Changeset.create!(
178 :repository => @repository,
178 :repository => @repository,
179 :committer => 'john <jsmith@somenet.foo>',
179 :committer => 'john <jsmith@somenet.foo>',
180 :committed_on => Time.now,
180 :committed_on => Time.now,
181 :revision => 100,
181 :revision => 100,
182 :comments => 'Committed by john.'
182 :comments => 'Committed by john.'
183 )
183 )
184 assert_equal User.find(2), c.user
184 assert_equal User.find(2), c.user
185 end
185 end
General Comments 0
You need to be logged in to leave comments. Login now