debian-mirror-gitlab/spec/lib/gitlab/data_builder/build_spec.rb

22 lines
683 B
Ruby
Raw Normal View History

2015-12-23 02:04:40 +05:30
require 'spec_helper'
2016-09-13 17:45:13 +05:30
describe Gitlab::DataBuilder::Build do
2015-12-23 02:04:40 +05:30
let(:build) { create(:ci_build) }
2016-08-24 12:49:21 +05:30
describe '.build' do
2015-12-23 02:04:40 +05:30
let(:data) do
2016-09-13 17:45:13 +05:30
described_class.build(build)
2015-12-23 02:04:40 +05:30
end
it { expect(data).to be_a(Hash) }
it { expect(data[:ref]).to eq(build.ref) }
it { expect(data[:sha]).to eq(build.sha) }
it { expect(data[:tag]).to eq(build.tag) }
it { expect(data[:build_id]).to eq(build.id) }
it { expect(data[:build_status]).to eq(build.status) }
it { expect(data[:build_allow_failure]).to eq(false) }
2015-12-23 02:04:40 +05:30
it { expect(data[:project_id]).to eq(build.project.id) }
it { expect(data[:project_name]).to eq(build.project.name_with_namespace) }
end
end