2015-11-16 08:39:19 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-09 05:55:49 -05:00
|
|
|
describe Milestones::CreateService, services: true do
|
2015-11-16 08:39:19 -05:00
|
|
|
let(:project) { create(:empty_project) }
|
|
|
|
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
|
|
|
|
project.team << [user, :master]
|
|
|
|
|
|
|
|
opts = {
|
|
|
|
title: 'v2.1.9',
|
|
|
|
description: 'Patch release to fix security issue'
|
|
|
|
}
|
|
|
|
|
|
|
|
@milestone = Milestones::CreateService.new(project, user, opts).execute
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(@milestone).to be_valid }
|
|
|
|
it { expect(@milestone.title).to eq('v2.1.9') }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|