Project

General

Profile

Defect #21136 ยป 231789.patch

Jan from Planio www.plan.io, 2015-11-02 22:43

View differences:

app/views/issues/show.api.rsb
end if include_in_api_response?('relations') && @relations.present?
api.array :changesets do
@issue.changesets.each do |changeset|
@changesets.each do |changeset|
api.changeset :revision => changeset.revision do
api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil?
api.comments changeset.comments
api.committed_on changeset.committed_on
end
end
end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project)
end if include_in_api_response?('changesets')
api.array :journals do
@journals.each do |journal|
test/fixtures/changesets.yml
user_id: 3
repository_id: 10
committer: dlopper
changesets_011:
commit_date: "2015-10-07"
comments: This is an empty changeset
committed_on: 2015-10-07 17:58:00
revision: "1"
id: 110
scmid:
user_id: 3
repository_id: 12
committer: dlopper
test/fixtures/changesets_issues.yml
---
changesets_issues_001:
changeset_id: 110
issue_id: 1
test/fixtures/repositories.yml
type: Repository::Subversion
is_default: true
created_on: 2006-07-19 19:04:21 +02:00
repositories_003:
project_id: 3
url: svn://localhost/test
id: 12
root_url: svn://localhost
password: ""
login: ""
type: Repository::Subversion
is_default: true
created_on: 2015-10-07 17:54:00 +02:00
test/integration/api_test/issues_test.rb
:journals,
:journal_details,
:queries,
:attachments
:attachments,
:changesets,
:changesets_issues
test "GET /issues.xml should contain metadata" do
get '/issues.xml'
......
end
end
test "GET /issues/:id.xml should not disclose associated changesets from projects the user has no access to" do
get '/issues/1.xml?include=changesets', {}, credentials('jsmith')
# the user jsmith has no permission to view the associated changeset
assert_select 'issue changesets[type=array]' do
assert_select 'changeset', 0
end
end
test "POST /issues.xml should create an issue with the attributes" do
payload = <<-XML
    (1-1/1)