BigW Consortium Gitlab

generic_commit_status_spec.rb 956 Bytes
Newer Older
1 2
require 'spec_helper'

Douwe Maan committed
3
describe GenericCommitStatus, models: true do
4 5
  let(:pipeline) { FactoryGirl.create :ci_pipeline }
  let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
6

7
  describe '#context' do
8 9 10 11 12 13
    subject { generic_commit_status.context }
    before { generic_commit_status.context = 'my_context' }

    it { is_expected.to eq(generic_commit_status.name) }
  end

14
  describe '#tags' do
15 16 17 18 19
    subject { generic_commit_status.tags }

    it { is_expected.to eq([:external]) }
  end

20
  describe 'set_default_values' do
21 22 23 24 25 26
    before do
      generic_commit_status.context = nil
      generic_commit_status.stage = nil
      generic_commit_status.save
    end

27
    describe '#context' do
28 29
      subject { generic_commit_status.context }

30
      it { is_expected.not_to be_nil }
31 32
    end

33
    describe '#stage' do
34 35
      subject { generic_commit_status.stage }

36
      it { is_expected.not_to be_nil }
37 38 39
    end
  end
end