summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/status/factory_spec.rb
blob: d5bd7f7102ba959fb9506572a2caf660650c2031 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe Gitlab::Ci::Status::Factory do
  subject do
    described_class.new(object)
  end

  let(:status) { subject.fabricate! }

  context 'when object has a core status' do
    HasStatus::AVAILABLE_STATUSES.each do |core_status|
      context "when core status is #{core_status}" do
        let(:object) { double(status: core_status) }

        it "fabricates a core status #{core_status}" do
          expect(status).to be_a(
            Gitlab::Ci::Status.const_get(core_status.capitalize))
        end
      end
    end
  end
end