BigW Consortium Gitlab

build_data_builder_spec.rb 690 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
require 'spec_helper'

describe 'Gitlab::BuildDataBuilder' do
  let(:build) { create(:ci_build) }

  describe :build do
    let(:data) do
      Gitlab::BuildDataBuilder.build(build)
    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) }
17
    it { expect(data[:build_allow_failure]).to eq(false) }
18 19
    it { expect(data[:project_id]).to eq(build.project.id) }
    it { expect(data[:project_name]).to eq(build.project.name_with_namespace) }
20 21
  end
end