gitlab-org--gitlab-foss/spec/models/generic_commit_status_spec.rb

40 lines
956 B
Ruby
Raw Normal View History

2015-10-06 06:01:16 -04:00
require 'spec_helper'
2015-12-09 04:50:51 -05:00
describe GenericCommitStatus, models: true do
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 }
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 }
it { is_expected.not_to be_nil }
2015-10-06 06:01:16 -04:00
end
end
end