diff options
author | Go MAEDA <maeda@farend.jp> | 2022-09-09 06:54:02 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-09-09 06:54:02 +0000 |
commit | 73e4fc28acaceb066ad04913f7b3e9c58f85382d (patch) | |
tree | 45bfad273ee265d6451e3e6e2ce4d922a0cc38f5 | |
parent | 8cbe5014b18dd88c4224a9e579d11ed5e5f6a17b (diff) | |
download | redmine-73e4fc28acaceb066ad04913f7b3e9c58f85382d.tar.gz redmine-73e4fc28acaceb066ad04913f7b3e9c58f85382d.zip |
Merged r21800 from trunk to 5.0-stable (#37585).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21802 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/repositories/_link_to_functions.html.erb | 2 | ||||
-rw-r--r-- | test/functional/repositories_filesystem_controller_test.rb | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb index 9c89561c3..bfdc99cc4 100644 --- a/app/views/repositories/_link_to_functions.html.erb +++ b/app/views/repositories/_link_to_functions.html.erb @@ -8,7 +8,7 @@ tabs << { name: 'entry', label: :button_view, tabs << { name: 'changes', label: :label_history, url: {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } - } + } if @repository.supports_all_revisions? tabs << { name: 'annotate', label: :button_annotate, url: {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } } if @repository.supports_annotate? diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb index 42c1f7dec..92f0edf8f 100644 --- a/test/functional/repositories_filesystem_controller_test.rb +++ b/test/functional/repositories_filesystem_controller_test.rb @@ -202,6 +202,24 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest @project.reload assert_nil @project.repository end + + def test_show_should_only_show_view_tab + get( + :entry, + :params => { + :id => PRJ_ID, + :repository_id => @repository.id, + :path => repository_path_hash(['test'])[:param] + } + ) + assert_response :success + assert @repository.supports_cat? + assert_select 'a#tab-entry', :text => /View/ + assert_not @repository.supports_all_revisions? + assert_select 'a#tab-changes', 0 + assert_not @repository.supports_annotate? + assert_select 'a#tab-annotate', 0 + end else puts "Filesystem test repository NOT FOUND. Skipping functional tests !!!" def test_fake; assert true end |