2015-10-24 18:46:33 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
describe GenericCommitStatus, models: true do
|
2016-06-16 23:09:34 +05:30
|
|
|
let(:pipeline) { FactoryGirl.create :ci_pipeline }
|
|
|
|
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
|
2015-10-24 18:46:33 +05:30
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe '#context' do
|
2015-10-24 18:46:33 +05:30
|
|
|
subject { generic_commit_status.context }
|
|
|
|
before { generic_commit_status.context = 'my_context' }
|
|
|
|
|
|
|
|
it { is_expected.to eq(generic_commit_status.name) }
|
|
|
|
end
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe '#tags' do
|
2015-10-24 18:46:33 +05:30
|
|
|
subject { generic_commit_status.tags }
|
|
|
|
|
|
|
|
it { is_expected.to eq([:external]) }
|
|
|
|
end
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe 'set_default_values' do
|
2015-10-24 18:46:33 +05:30
|
|
|
before do
|
|
|
|
generic_commit_status.context = nil
|
|
|
|
generic_commit_status.stage = nil
|
|
|
|
generic_commit_status.save
|
|
|
|
end
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe '#context' do
|
2015-10-24 18:46:33 +05:30
|
|
|
subject { generic_commit_status.context }
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
it { is_expected.not_to be_nil }
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
describe '#stage' do
|
2015-10-24 18:46:33 +05:30
|
|
|
subject { generic_commit_status.stage }
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
it { is_expected.not_to be_nil }
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|