diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/lib/gitlab/ci/status/bridge/factory_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/status/bridge/factory_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/status/bridge/factory_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/status/bridge/factory_spec.rb b/spec/lib/gitlab/ci/status/bridge/factory_spec.rb index d27bb98ba9a..6081f104e42 100644 --- a/spec/lib/gitlab/ci/status/bridge/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/bridge/factory_spec.rb @@ -117,14 +117,31 @@ RSpec.describe Gitlab::Ci::Status::Bridge::Factory do end end + context 'when bridge is waiting for resource' do + let(:bridge) { create_bridge(:waiting_for_resource, :resource_group) } + + it 'matches correct core status' do + expect(factory.core_status).to be_a Gitlab::Ci::Status::WaitingForResource + end + + it 'fabricates status with correct details' do + expect(status.text).to eq 'waiting' + expect(status.group).to eq 'waiting-for-resource' + expect(status.icon).to eq 'status_pending' + expect(status.favicon).to eq 'favicon_pending' + expect(status.illustration).to include(:image, :size, :title) + expect(status).not_to have_details + end + end + private - def create_bridge(trait) + def create_bridge(*traits) upstream_project = create(:project, :repository) downstream_project = create(:project, :repository) upstream_pipeline = create(:ci_pipeline, :running, project: upstream_project) trigger = { trigger: { project: downstream_project.full_path, branch: 'feature' } } - create(:ci_bridge, trait, options: trigger, pipeline: upstream_pipeline) + create(:ci_bridge, *traits, options: trigger, pipeline: upstream_pipeline) end end |