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

26 lines
838 B
Ruby
Raw 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) }
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