debian-mirror-gitlab/spec/models/releases/evidence_spec.rb

27 lines
839 B
Ruby
Raw Permalink Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Releases::Evidence do
2019-12-21 20:55:43 +05:30
let_it_be(:project) { create(:project) }
2021-06-08 01:23:25 +05:30
2019-12-21 20:55:43 +05:30
let(:release) { create(:release, project: project) }
describe 'associations' do
it { is_expected.to belong_to(:release) }
end
2020-06-23 00:09:42 +05:30
it 'filters out issues from summary json' do
milestone = create(:milestone, project: project, due_date: nil)
issue = create(:issue, project: project, description: nil, state: 'closed')
milestone.issues << issue
release.milestones << milestone
2019-12-21 20:55:43 +05:30
2020-06-23 00:09:42 +05:30
::Releases::CreateEvidenceService.new(release).execute
evidence = release.evidences.last
2019-12-21 20:55:43 +05:30
2020-06-23 00:09:42 +05:30
expect(evidence.read_attribute(:summary)["release"]["milestones"].first["issues"].first["title"]).to be_present
expect(evidence.summary["release"]["milestones"].first["issues"]).to be_nil
2019-12-21 20:55:43 +05:30
end
end