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

40 lines
941 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
2015-10-06 06:01:16 -04:00
let(:commit) { FactoryGirl.create :ci_commit }
2016-06-03 06:29:00 -04:00
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: commit }
2015-10-06 06:01:16 -04:00
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.not_to be_nil }
2015-10-06 06:01:16 -04:00
end
describe :stage do
subject { generic_commit_status.stage }
it { is_expected.not_to be_nil }
2015-10-06 06:01:16 -04:00
end
end
end