Add some missing tests for detailed status methods

parent 309580bd
Pipeline #5390498 passed with stages
in 132 minutes and 26 seconds
......@@ -1246,4 +1246,13 @@ describe Ci::Build, models: true do
it { is_expected.to eq('review/master') }
end
end
describe '#detailed_status' do
let(:user) { create(:user) }
it 'returns a detailed status' do
expect(build.detailed_status(user))
.to be_a Gitlab::Ci::Status::Build::Cancelable
end
end
end
......@@ -234,4 +234,13 @@ describe CommitStatus, models: true do
end
end
end
describe '#detailed_status' do
let(:user) { create(:user) }
it 'returns a detailed status' do
expect(commit_status.detailed_status(user))
.to be_a Gitlab::Ci::Status::Success
end
end
end
require 'spec_helper'
describe GenericCommitStatus, models: true do
let(:pipeline) { FactoryGirl.create :ci_pipeline }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
let(:pipeline) { create(:ci_pipeline) }
let(:generic_commit_status) do
create(:generic_commit_status, pipeline: pipeline)
end
describe '#context' do
subject { generic_commit_status.context }
......@@ -17,6 +20,15 @@ describe GenericCommitStatus, models: true do
it { is_expected.to eq([:external]) }
end
describe '#detailed_status' do
let(:user) { create(:user) }
it 'returns detailed status object' do
expect(generic_commit_status.detailed_status(user))
.to be_a Gitlab::Ci::Status::Success
end
end
describe 'set_default_values' do
before do
generic_commit_status.context = nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment