]> source.dussan.org Git - redmine.git/commitdiff
Add missing Homepage attribute in Projects API response (#39113).
authorGo MAEDA <maeda@farend.jp>
Sun, 15 Oct 2023 02:18:26 +0000 (02:18 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 15 Oct 2023 02:18:26 +0000 (02:18 +0000)
Patch by Vincent Robert.

git-svn-id: https://svn.redmine.org/redmine/trunk@22345 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/projects/index.api.rsb
test/integration/api_test/projects_test.rb

index 03c7c0c77502ce57e55d29c8cc006b2b62ce9df1..1f8ff74f7fb621a3d1453221e4f8af65ae5f5f69 100644 (file)
@@ -5,6 +5,7 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
       api.name        project.name
       api.identifier  project.identifier
       api.description project.description
+      api.homepage    project.homepage
       api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
       api.status      project.status
       api.is_public   project.is_public?
index c32f7679bbc178017cf15e2ecc4931a187d41ca5..fbe0d1cbe701a53ea67a42e2be5ac1061d1ff060 100644 (file)
@@ -45,6 +45,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
       assert_select '>status', :text => '1'
       assert_select '>is_public', :text => 'true'
       assert_select '>inherit_members', :text => 'true'
+      assert_select '>homepage', :text => 'http://ecookbook.somenet.foo/'
     end
   end
 
@@ -59,6 +60,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
     assert_kind_of Hash, json['projects'].first
     assert json['projects'].first.has_key?('id')
     assert json['projects'].first.has_key?('inherit_members')
+    assert json['projects'].first.has_key?('homepage')
   end
 
   test "GET /projects.xml with include=issue_categories should return categories" do
@@ -109,6 +111,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
     assert_select 'project>status', :text => '1'
     assert_select 'project>is_public', :text => 'true'
     assert_select 'project>inherit_members', :text => 'true'
+    assert_select 'project>homepage', :text => 'http://ecookbook.somenet.foo/'
     assert_select 'custom_field[name="Development status"]', :text => 'Stable'
 
     assert_select 'trackers', 0
@@ -125,6 +128,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
     assert_equal false, json['project']['inherit_members']
     assert_equal false, json['project'].has_key?('default_version')
     assert_equal false, json['project'].has_key?('default_assignee')
+    assert_equal 'http://ecookbook.somenet.foo/', json['project']['homepage']
   end
 
   test "GET /projects/:id.xml with hidden custom fields should not display hidden custom fields" do