Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-04-07 01:32:44 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-04-07 01:32:44 +0300
commit9421a597b749b50b75c05f94a144f2a7885b5ee0 (patch)
tree521e064762bd49d4a03b76f8c98ddf9f679ca71c /spec/lib/gitlab/ci/status/build/skipped_spec.rb
parent034828fbebf0e6b795ab9634b2544ac007221f1a (diff)
parent6d0c9c9403483a274dfe55094123a99a1937bbff (diff)
Merge branch '42568-pipeline-empty-state' into 'master'
Resolve "Wrong empty state for cancelled build, hides existing logs!" Closes #42568 See merge request gitlab-org/gitlab-ce!17646
Diffstat (limited to 'spec/lib/gitlab/ci/status/build/skipped_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/status/build/skipped_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/status/build/skipped_spec.rb b/spec/lib/gitlab/ci/status/build/skipped_spec.rb
new file mode 100644
index 00000000000..46f6933025a
--- /dev/null
+++ b/spec/lib/gitlab/ci/status/build/skipped_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe Gitlab::Ci::Status::Build::Skipped do
+ let(:user) { create(:user) }
+
+ subject do
+ described_class.new(double('subject'))
+ end
+
+ describe '#illustration' do
+ it { expect(subject.illustration).to include(:image, :size, :title) }
+ end
+
+ describe '.matches?' do
+ subject {described_class.matches?(build, user) }
+
+ context 'when build is skipped' do
+ let(:build) { create(:ci_build, :skipped) }
+
+ it 'is a correct match' do
+ expect(subject).to be true
+ end
+ end
+
+ context 'when build is not skipped' do
+ let(:build) { create(:ci_build) }
+
+ it 'does not match' do
+ expect(subject).to be false
+ end
+ end
+ end
+end