gitlab-org--gitlab-foss/spec/services/milestones/close_service_spec.rb
Thong Kuah 85b29c1c2f Add frozen_string_literal to spec/services
Probably useful as we often move these files to "new" files.
2019-04-12 10:14:54 +12:00

30 lines
732 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe Milestones::CloseService do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) }
before do
project.add_maintainer(user)
end
describe '#execute' do
before do
described_class.new(project, user, {}).execute(milestone)
end
it { expect(milestone).to be_valid }
it { expect(milestone).to be_closed }
describe 'event' do
let(:event) { Event.recent.first }
it { expect(event.milestone).to be_truthy }
it { expect(event.target).to eq(milestone) }
it { expect(event.action_name).to eq('closed') }
end
end
end