debian-mirror-gitlab/spec/models/group_milestone_spec.rb

33 lines
784 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe GroupMilestone do
2017-08-17 22:00:37 +05:30
let(:group) { create(:group) }
2017-09-10 17:25:29 +05:30
let(:project) { create(:project, group: group) }
2017-08-17 22:00:37 +05:30
let(:project_milestone) do
create(:milestone, title: "Milestone v1.2", project: project)
end
describe '.build' do
it 'returns milestone with group assigned' do
2017-09-10 17:25:29 +05:30
milestone = described_class.build(
2017-08-17 22:00:37 +05:30
group,
[project],
project_milestone.title
)
expect(milestone.group).to eq group
end
end
describe '.build_collection' do
before do
project_milestone
end
it 'returns array of milestones, each with group assigned' do
2017-09-10 17:25:29 +05:30
milestones = described_class.build_collection(group, [project], {})
2017-08-17 22:00:37 +05:30
expect(milestones).to all(have_attributes(group: group))
end
end
end