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