debian-mirror-gitlab/spec/services/milestones/create_service_spec.rb

27 lines
623 B
Ruby
Raw Permalink Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
2015-11-26 14:37:03 +05:30
require 'spec_helper'
2023-05-27 22:25:52 +05:30
RSpec.describe Milestones::CreateService, feature_category: :team_planning do
2017-09-10 17:25:29 +05:30
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