2015-10-06 06:01:16 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-09 04:50:51 -05:00
|
|
|
describe GenericCommitStatus, models: true do
|
2016-06-03 10:22:26 -04:00
|
|
|
let(:pipeline) { FactoryGirl.create :ci_pipeline }
|
|
|
|
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
|
2015-10-06 06:01:16 -04:00
|
|
|
|
2016-07-11 18:12:31 -04:00
|
|
|
describe '#context' do
|
2015-10-06 06:01:16 -04:00
|
|
|
subject { generic_commit_status.context }
|
|
|
|
before { generic_commit_status.context = 'my_context' }
|
|
|
|
|
|
|
|
it { is_expected.to eq(generic_commit_status.name) }
|
|
|
|
end
|
|
|
|
|
2016-07-11 18:12:31 -04:00
|
|
|
describe '#tags' do
|
2015-10-06 06:01:16 -04:00
|
|
|
subject { generic_commit_status.tags }
|
|
|
|
|
|
|
|
it { is_expected.to eq([:external]) }
|
|
|
|
end
|
|
|
|
|
2016-07-11 18:12:31 -04:00
|
|
|
describe 'set_default_values' do
|
2015-10-06 06:01:16 -04:00
|
|
|
before do
|
|
|
|
generic_commit_status.context = nil
|
|
|
|
generic_commit_status.stage = nil
|
|
|
|
generic_commit_status.save
|
|
|
|
end
|
|
|
|
|
2016-07-11 18:12:31 -04:00
|
|
|
describe '#context' do
|
2015-10-06 06:01:16 -04:00
|
|
|
subject { generic_commit_status.context }
|
|
|
|
|
2016-05-23 19:37:59 -04:00
|
|
|
it { is_expected.not_to be_nil }
|
2015-10-06 06:01:16 -04:00
|
|
|
end
|
|
|
|
|
2016-07-11 18:12:31 -04:00
|
|
|
describe '#stage' do
|
2015-10-06 06:01:16 -04:00
|
|
|
subject { generic_commit_status.stage }
|
|
|
|
|
2016-05-23 19:37:59 -04:00
|
|
|
it { is_expected.not_to be_nil }
|
2015-10-06 06:01:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|