debian-mirror-gitlab/spec/services/ci/event_service_spec.rb

35 lines
942 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
require 'spec_helper'
describe Ci::EventService do
2015-10-24 18:46:33 +05:30
let(:project) { FactoryGirl.create :ci_project }
2015-09-25 12:07:36 +05:30
let(:user) { double(username: "root", id: 1) }
before do
Event.destroy_all
end
describe :remove_project do
it "creates event" do
Ci::EventService.new.remove_project(user, project)
2015-10-24 18:46:33 +05:30
expect(Ci::Event.admin.last.description).to eq("Project \"#{project.name_with_namespace}\" has been removed by root")
2015-09-25 12:07:36 +05:30
end
end
describe :create_project do
it "creates event" do
Ci::EventService.new.create_project(user, project)
2015-10-24 18:46:33 +05:30
expect(Ci::Event.admin.last.description).to eq("Project \"#{project.name_with_namespace}\" has been created by root")
2015-09-25 12:07:36 +05:30
end
end
describe :change_project_settings do
it "creates event" do
Ci::EventService.new.change_project_settings(user, project)
expect(Ci::Event.last.description).to eq("User \"root\" updated projects settings")
end
end
end