Feature #4155 » fix-scmid-all-number.diff
| app/models/changeset.rb | ||
|---|---|---|
| 126 | 126 |
end |
| 127 | 127 | |
| 128 | 128 |
def text_tag |
| 129 |
c = scmid? ? scmid : revision |
|
| 130 |
if c.to_s =~ /^[0-9]*$/ |
|
| 131 |
"r#{c}"
|
|
| 129 |
if scmid? |
|
| 130 |
"commit:#{scmid}"
|
|
| 132 | 131 |
else |
| 133 |
"commit:#{c}"
|
|
| 132 |
"r#{revision}"
|
|
| 134 | 133 |
end |
| 135 | 134 |
end |
| 136 | 135 |
|
| test/unit/changeset_test.rb | ||
|---|---|---|
| 75 | 75 |
c = Changeset.new(:repository => Project.find(1).repository, |
| 76 | 76 |
:committed_on => 24.hours.ago, |
| 77 | 77 |
:comments => 'Worked on this issue #1 @2h', |
| 78 |
:scmid => '520', |
|
| 79 | 78 |
:revision => '520', |
| 80 | 79 |
:user => User.find(2)) |
| 81 | 80 |
assert_difference 'TimeEntry.count' do |
| ... | ... | |
| 171 | 170 |
assert c.issues.first.project != c.project |
| 172 | 171 |
end |
| 173 | 172 |
|
| 174 |
def test_text_tag_numeric
|
|
| 175 |
c = Changeset.new(:scmid => '520', :revision => '520')
|
|
| 173 |
def test_text_tag_revision
|
|
| 174 |
c = Changeset.new(:revision => '520') |
|
| 176 | 175 |
assert_equal 'r520', c.text_tag |
| 177 | 176 |
end |
| 178 | 177 |
|
| ... | ... | |
| 181 | 180 |
assert_equal 'commit:7234cb2750b63f47bff735edc50a1c0a433c2518', c.text_tag |
| 182 | 181 |
end |
| 183 | 182 | |
| 183 |
def test_text_tag_hash_all_number |
|
| 184 |
c = Changeset.new(:scmid => '0123456789', :revision => '0123456789') |
|
| 185 |
assert_equal 'commit:0123456789', c.text_tag |
|
| 186 |
end |
|
| 187 | ||
| 184 | 188 |
def test_previous |
| 185 | 189 |
changeset = Changeset.find_by_revision('3')
|
| 186 | 190 |
assert_equal Changeset.find_by_revision('2'), changeset.previous
|
- « Previous
- 1
- …
- 11
- 12
- 13
- Next »