summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-30 04:00:57 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-30 04:00:57 +0000
commitd97beec1d4cc773dd8fb8a5245efb040235f86b1 (patch)
treeddbd3486f207256f3072dfacf3598487792cf5de /test
parent24fc9a2a8e1b3f8212db890d7f82baf2d7a4b535 (diff)
downloadredmine-d97beec1d4cc773dd8fb8a5245efb040235f86b1.tar.gz
redmine-d97beec1d4cc773dd8fb8a5245efb040235f86b1.zip
Add "View annotation prior to this change" button in the annotate view of Git (#35432).
Patch by Takenori TAKAKI. git-svn-id: https://svn.redmine.org/redmine/trunk@22217 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/repositories_git_controller_test.rb5
-rw-r--r--test/unit/lib/redmine/scm/adapters/git_adapter_test.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index 01f745de6..5367c3cf2 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -589,9 +589,14 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest
# Line 23, changeset 2f9c0091
assert_select 'tr' do
+ prev_blame, path = '4a79347ea4b7184938d9bbea0fd421a6079f71bb', 'sources/watchers_controller.rb'
assert_select 'th.line-num a[data-txt=?]', '23'
assert_select 'td.revision', :text => /2f9c0091/
assert_select 'td.author', :text => 'jsmith'
+ assert_select 'td.previous' do
+ assert_select 'a.icon-history[href=?]',
+ "/projects/subproject1/repository/#{@repository.id}/revisions/#{prev_blame}/annotate/#{path}"
+ end
assert_select 'td', :text => /remove_watcher/
end
end
diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
index b81261c41..68bc37def 100644
--- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
@@ -437,6 +437,10 @@ class GitAdapterTest < ActiveSupport::TestCase
assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518",
annotate.revisions[4].identifier
assert_equal "jsmith", annotate.revisions[4].author
+ assert_equal "4a79347ea4b7184938d9bbea0fd421a6079f71bb",
+ annotate.previous_annotations[22].split[0]
+ assert_equal "sources/watchers_controller.rb",
+ annotate.previous_annotations[22].split[1]
end
def test_annotate_latin_1_identifier