summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-09-05 04:08:30 +0000
committerGo MAEDA <maeda@farend.jp>2019-09-05 04:08:30 +0000
commit2782d4b9f9a55818336ccb5fde85cb0cef9c5fc2 (patch)
treec7b846d8906beab53cbdee35e04aa0a075960039 /test/integration
parente96c4c4a2e65a59a0ed72c7fb1f9859bef7eef5e (diff)
downloadredmine-2782d4b9f9a55818336ccb5fde85cb0cef9c5fc2.tar.gz
redmine-2782d4b9f9a55818336ccb5fde85cb0cef9c5fc2.zip
Add inherit_members to projects API response (#32002).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18431 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/projects_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index ee5c53a7c..6c7496fc4 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -30,13 +30,20 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
end
test "GET /projects.xml should return projects" do
+ project = Project.find(1)
+ project.inherit_members = '1'
+ project.save!
+
get '/projects.xml'
assert_response :success
assert_equal 'application/xml', @response.content_type
- assert_select 'projects>project>id', :text => '1'
- assert_select 'projects>project>status', :text => '1'
- assert_select 'projects>project>is_public', :text => 'true'
+ assert_select 'projects>project:first-child' do
+ assert_select '>id', :text => '1'
+ assert_select '>status', :text => '1'
+ assert_select '>is_public', :text => 'true'
+ assert_select '>inherit_members', :text => 'true'
+ end
end
test "GET /projects.json should return projects" do
@@ -49,6 +56,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
assert_kind_of Array, json['projects']
assert_kind_of Hash, json['projects'].first
assert json['projects'].first.has_key?('id')
+ assert json['projects'].first.has_key?('inherit_members')
end
test "GET /projects.xml with include=issue_categories should return categories" do
@@ -76,6 +84,8 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
end
test "GET /projects/:id.xml should return the project" do
+ Project.find(1).update!(:inherit_members => '1')
+
get '/projects/1.xml'
assert_response :success
assert_equal 'application/xml', @response.content_type
@@ -83,6 +93,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
assert_select 'project>id', :text => '1'
assert_select 'project>status', :text => '1'
assert_select 'project>is_public', :text => 'true'
+ assert_select 'project>inherit_members', :text => 'true'
assert_select 'custom_field[name="Development status"]', :text => 'Stable'
assert_select 'trackers', 0
@@ -96,6 +107,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
assert_kind_of Hash, json
assert_kind_of Hash, json['project']
assert_equal 1, json['project']['id']
+ assert_equal false, json['project']['inherit_members']
end
test "GET /projects/:id.xml with hidden custom fields should not display hidden custom fields" do