gitlab-org--gitlab-foss/spec/services/milestones/close_service_spec.rb

29 lines
735 B
Ruby
Raw Normal View History

require 'spec_helper'
2015-12-09 05:55:49 -05:00
describe Milestones::CloseService, services: true do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) }
before do
project.team << [user, :master]
end
2016-07-11 18:12:31 -04:00
describe '#execute' do
before do
Milestones::CloseService.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