BigW Consortium Gitlab

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

Douwe Maan committed
3
describe GenericCommitStatus, models: true do
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
  let(:commit) { FactoryGirl.create :ci_commit }
  let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, commit: commit }

  describe :context do
    subject { generic_commit_status.context }
    before { generic_commit_status.context = 'my_context' }

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

  describe :tags do
    subject { generic_commit_status.tags }

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

  describe :set_default_values do
    before do
      generic_commit_status.context = nil
      generic_commit_status.stage = nil
      generic_commit_status.save
    end

    describe :context do
      subject { generic_commit_status.context }

      it { is_expected.to_not be_nil }
    end

    describe :stage do
      subject { generic_commit_status.stage }

      it { is_expected.to_not be_nil }
    end
  end
end