2019-04-11 12:17:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-11-16 13:39:19 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 15:08:50 +00:00
|
|
|
RSpec.describe Milestones::CreateService do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2015-11-16 13:39:19 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2016-07-11 22:12:31 +00:00
|
|
|
describe '#execute' do
|
2015-11-16 13:39:19 +00:00
|
|
|
context "valid params" do
|
|
|
|
before do
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2015-11-16 13:39:19 +00:00
|
|
|
|
|
|
|
opts = {
|
|
|
|
title: 'v2.1.9',
|
|
|
|
description: 'Patch release to fix security issue'
|
|
|
|
}
|
|
|
|
|
2017-07-25 17:09:00 +00:00
|
|
|
@milestone = described_class.new(project, user, opts).execute
|
2015-11-16 13:39:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(@milestone).to be_valid }
|
|
|
|
it { expect(@milestone.title).to eq('v2.1.9') }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|