Commit a75e7fcc authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch...

Merge branch '213072-vulnerability-confirm-endpoint-does-not-have-the-confirmed_at-and-confirmed_by_id-properties' into 'master'

Add confirmed_at/confirmed_by properties to confirm API endpoint

See merge request gitlab-org/gitlab!28945
parents cc8a18a8 bf868c7b
...@@ -24,6 +24,7 @@ module EE ...@@ -24,6 +24,7 @@ module EE
expose :last_edited_by_id expose :last_edited_by_id
expose :resolved_by_id expose :resolved_by_id
expose :dismissed_by_id expose :dismissed_by_id
expose :confirmed_by_id
expose :start_date expose :start_date
expose :due_date expose :due_date
...@@ -33,6 +34,7 @@ module EE ...@@ -33,6 +34,7 @@ module EE
expose :last_edited_at expose :last_edited_at
expose :resolved_at expose :resolved_at
expose :dismissed_at expose :dismissed_at
expose :confirmed_at
end end
end end
end end
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
"updated_by_id": { "type": ["integer", "null"] }, "updated_by_id": { "type": ["integer", "null"] },
"last_edited_by_id": { "type": ["integer", "null"] }, "last_edited_by_id": { "type": ["integer", "null"] },
"resolved_by_id": { "type": ["integer", "null"] }, "resolved_by_id": { "type": ["integer", "null"] },
"dismissed_by_id": { "type": ["integer", "null"] },
"confirmed_by_id": { "type": ["integer", "null"] },
"closed_by_id": { "type": ["integer", "null"] }, "closed_by_id": { "type": ["integer", "null"] },
"start_date": { "type": ["date", "null"] }, "start_date": { "type": ["date", "null"] },
"due_date": { "type": ["date", "null"] }, "due_date": { "type": ["date", "null"] },
...@@ -40,6 +42,8 @@ ...@@ -40,6 +42,8 @@
"updated_at": { "type": "date" }, "updated_at": { "type": "date" },
"last_edited_at": { "type": "date" }, "last_edited_at": { "type": "date" },
"resolved_at": { "type": "date" }, "resolved_at": { "type": "date" },
"dismissed_at": { "type": "date" },
"confirmed_at": { "type": "date" },
"closed_at": { "type": "date" } "closed_at": { "type": "date" }
} }
} }
# frozen_string_literal: true
require 'spec_helper'
describe ::EE::API::Entities::Vulnerability do
before do
create_list(:vulnerabilities_finding, 2, vulnerability: vulnerability)
end
let_it_be(:project) { create(:project, :with_vulnerabilities) }
let(:vulnerability) { project.vulnerabilities.first }
let(:entity) { described_class.new(vulnerability)}
subject { entity.as_json }
it 'contains vulnerability properties' do
expect(subject[:id]).to eq(vulnerability.id)
expect(subject[:title]).to eq(vulnerability.title)
expect(subject[:description]).to eq(vulnerability.description)
expect(subject[:state]).to eq(vulnerability.state)
expect(subject[:severity]).to eq(vulnerability.severity)
expect(subject[:confidence]).to eq(vulnerability.confidence)
expect(subject[:report_type]).to eq(vulnerability.report_type)
expect(subject[:project][:id]).to eq(vulnerability.project_id)
expect(subject[:finding]['id']).to eq(vulnerability.finding_ids.last)
expect(subject[:resolved_on_default_branch]).to eq(vulnerability.resolved_on_default_branch)
expect(subject[:project_default_branch]).to eq(vulnerability.project_default_branch)
expect(subject[:author_id]).to eq(vulnerability.author_id)
expect(subject[:updated_by_id]).to eq(vulnerability.updated_by_id)
expect(subject[:last_edited_by_id]).to eq(vulnerability.last_edited_by_id)
expect(subject[:resolved_by_id]).to eq(vulnerability.resolved_by_id)
expect(subject[:dismissed_by_id]).to eq(vulnerability.dismissed_by_id)
expect(subject[:confirmed_by_id]).to eq(vulnerability.confirmed_by_id)
expect(subject[:start_date]).to eq(vulnerability.start_date)
expect(subject[:due_date]).to eq(vulnerability.due_date)
expect(subject[:created_at]).to eq(vulnerability.created_at)
expect(subject[:updated_at]).to eq(vulnerability.updated_at)
expect(subject[:last_edited_at]).to eq(vulnerability.last_edited_at)
expect(subject[:resolved_at]).to eq(vulnerability.resolved_at)
expect(subject[:dismissed_at]).to eq(vulnerability.dismissed_at)
expect(subject[:confirmed_at]).to eq(vulnerability.confirmed_at)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment