summaryrefslogtreecommitdiff
path: root/spec/services/milestones/create_service_spec.rb
blob: c6fe8e65912c9b14d8488f7c04853e2c683ee517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'

describe Milestones::CreateService do
  let(:project) { create(:empty_project) }
  let(:user) { create(:user) }

  describe '#execute' do
    context "valid params" do
      before do
        project.team << [user, :master]

        opts = {
          title: 'v2.1.9',
          description: 'Patch release to fix security issue'
        }

        @milestone = described_class.new(project, user, opts).execute
      end

      it { expect(@milestone).to be_valid }
      it { expect(@milestone.title).to eq('v2.1.9') }
    end
  end
end