2015-11-26 14:37:03 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Milestones::CreateService do
|
|
|
|
let(:project) { create(:project) }
|
2015-11-26 14:37:03 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe '#execute' do
|
2015-11-26 14:37:03 +05:30
|
|
|
context "valid params" do
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2015-11-26 14:37:03 +05:30
|
|
|
|
|
|
|
opts = {
|
|
|
|
title: 'v2.1.9',
|
|
|
|
description: 'Patch release to fix security issue'
|
|
|
|
}
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
@milestone = described_class.new(project, user, opts).execute
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(@milestone).to be_valid }
|
|
|
|
it { expect(@milestone.title).to eq('v2.1.9') }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|