summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-02-27 07:21:35 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-02-27 07:21:35 +0000
commit9985b73332b734f53c6c09f28e1eeeeb691d53ec (patch)
treeb52a6f29f8816173874a743ebd778c45500e49e4 /test
parent6cd364caaa1cdc905fb64890a885eec5ceb221cb (diff)
downloadredmine-9985b73332b734f53c6c09f28e1eeeeb691d53ec.tar.gz
redmine-9985b73332b734f53c6c09f28e1eeeeb691d53ec.zip
Merged r22739 and r22745 from trunk to 5.1-stable (#39995).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22748 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/activities_controller_test.rb28
-rw-r--r--test/functional/versions_controller_test.rb16
2 files changed, 44 insertions, 0 deletions
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index fbbf9e601..0646df97f 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -45,6 +45,34 @@ class ActivitiesControllerTest < Redmine::ControllerTest
assert_select 'dl dt.issue-edit a', :text => /(#{IssueStatus.find(2).name})/
end
+ def test_index_subproject_checkbox_should_check_descendants_visibility
+ @request.session[:user_id] = 2
+ get(
+ :index,
+ :params => {
+ :id => 5,
+ }
+ )
+ assert_response :success
+
+ assert_select '#sidebar input#with_subprojects'
+
+ project = Project.find(6)
+ project.is_public = false
+ project.save
+
+ get(
+ :index,
+ :params => {
+ :id => 5,
+ }
+ )
+ assert_response :success
+
+ assert_select '#sidebar input#with_subprojects', :count => 0
+
+ end
+
def test_project_index_with_invalid_project_id_should_respond_404
get(:index, :params => {:id => 299})
assert_response 404
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index 5b72f4c48..0e6b018f6 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -87,6 +87,8 @@ class VersionsControllerTest < Redmine::ControllerTest
assert_select 'h3', :text => Version.find(4).name
# Subproject version
assert_select 'h3', :text => /#{version_name}/
+ # Subproject checkbox
+ assert_select '#sidebar input[id=?][value=?]', "with_subprojects", 1
end
def test_index_should_prepend_shared_versions
@@ -119,6 +121,20 @@ class VersionsControllerTest < Redmine::ControllerTest
end
end
+ def test_index_subproject_checkbox_should_check_descendants_visibility
+ project = Project.find(6)
+ project.is_public = false
+ project.save
+
+ @request.session[:user_id] = 2
+
+ get :index, :params => {:project_id => 5, :with_subprojects => 1}
+ assert_response :success
+
+ # Subproject checkbox should not be shown
+ assert_select '#sidebar input[id=?]', "with_subprojects", :count => 0
+ end
+
def test_show
with_settings :gravatar_enabled => '0' do
get :show, :params => {:id => 2}