gitlab-org--gitlab-foss/spec/services/ci/create_builds_service_spec.rb
Kamil Trzcinski af7214d0f0 Fix specs
2016-04-11 23:32:55 +02:00

28 lines
662 B
Ruby

require 'spec_helper'
describe Ci::CreateBuildsService, services: true do
let(:commit) { create(:ci_commit, ref: 'master') }
let(:user) { create(:user) }
describe '#execute' do
# Using stubbed .gitlab-ci.yml created in commit factory
#
subject do
described_class.new(commit).execute(commit, nil, user, status)
end
context 'next builds available' do
let(:status) { 'success' }
it { is_expected.to be_an_instance_of Array }
it { is_expected.to all(be_an_instance_of Ci::Build) }
end
context 'builds skipped' do
let(:status) { 'skipped' }
it { is_expected.to be_empty }
end
end
end