summaryrefslogtreecommitdiff
path: root/spec/presenters/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 00:07:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 00:07:48 +0000
commit2349eabc1a473bfb70555f0ce6d3d808cecb181d (patch)
tree0dae6a2a6810f2198eed42b7f9566ebf9c292468 /spec/presenters/ci
parent134fe182008dc13a16f12d723aa73771efb1a6a2 (diff)
downloadgitlab-ce-2349eabc1a473bfb70555f0ce6d3d808cecb181d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters/ci')
-rw-r--r--spec/presenters/ci/legacy_stage_presenter_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/presenters/ci/legacy_stage_presenter_spec.rb b/spec/presenters/ci/legacy_stage_presenter_spec.rb
new file mode 100644
index 00000000000..932cfacafb1
--- /dev/null
+++ b/spec/presenters/ci/legacy_stage_presenter_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Ci::LegacyStagePresenter do
+ let(:legacy_stage) { create(:ci_stage) }
+ let(:presenter) { described_class.new(legacy_stage) }
+
+ let!(:build) { create(:ci_build, :tags, pipeline: legacy_stage.pipeline, stage: legacy_stage.name) }
+ let!(:retried_build) { create(:ci_build, :tags, :retried, pipeline: legacy_stage.pipeline, stage: legacy_stage.name) }
+
+ before do
+ create(:generic_commit_status, pipeline: legacy_stage.pipeline, stage: legacy_stage.name)
+ end
+
+ describe '#latest_ordered_statuses' do
+ subject(:latest_ordered_statuses) { presenter.latest_ordered_statuses }
+
+ it 'preloads build tags' do
+ expect(latest_ordered_statuses.second.association(:tags)).to be_loaded
+ end
+ end
+
+ describe '#retried_ordered_statuses' do
+ subject(:retried_ordered_statuses) { presenter.retried_ordered_statuses }
+
+ it 'preloads build tags' do
+ expect(retried_ordered_statuses.first.association(:tags)).to be_loaded
+ end
+ end
+end