diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/serializers/ci/job_entity_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/serializers/ci/job_entity_spec.rb')
-rw-r--r-- | spec/serializers/ci/job_entity_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/serializers/ci/job_entity_spec.rb b/spec/serializers/ci/job_entity_spec.rb index ba68b9a6c16..05b9e38444c 100644 --- a/spec/serializers/ci/job_entity_spec.rb +++ b/spec/serializers/ci/job_entity_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' RSpec.describe Ci::JobEntity do let(:user) { create(:user) } - let(:job) { create(:ci_build) } + let(:job) { create(:ci_build, :running) } let(:project) { job.project } let(:request) { double('request') } @@ -21,6 +21,11 @@ RSpec.describe Ci::JobEntity do subject { entity.as_json } + it 'contains started' do + expect(subject).to include(:started) + expect(subject[:started]).to eq(true) + end + it 'contains complete to indicate if a pipeline is completed' do expect(subject).to include(:complete) end @@ -128,6 +133,15 @@ RSpec.describe Ci::JobEntity do end end + context 'when job is running' do + let_it_be(:job) { create(:ci_build, :running) } + + it 'contains started_at' do + expect(subject[:started]).to be_truthy + expect(subject[:started_at]).to eq(job.started_at) + end + end + context 'when job is generic commit status' do let(:job) { create(:generic_commit_status, target_url: 'http://google.com') } |