summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/status/build/canceled_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-04-10 13:56:17 +0100
committerSean McGivern <sean@gitlab.com>2018-04-10 13:56:17 +0100
commitc5a4b4ec7b4dfeeeb99dc105ea61d094d779efdf (patch)
treee1ef0535f76ea0ca17ee95cba2e35d7d7c58e502 /spec/lib/gitlab/ci/status/build/canceled_spec.rb
parent2fd7be8c0303afe4394f829ef4db0555dd1c3afa (diff)
parent89c3c4ccec639f23fd7b2c7f64e5b60b1b5708c8 (diff)
downloadgitlab-ce-c5a4b4ec7b4dfeeeb99dc105ea61d094d779efdf.tar.gz
Merge branch 'master' into satishperala/gitlab-ce-20720_webhooks_full_image_urlsatishperala/gitlab-ce-20720_webhooks_full_image_url
Diffstat (limited to 'spec/lib/gitlab/ci/status/build/canceled_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/status/build/canceled_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/status/build/canceled_spec.rb b/spec/lib/gitlab/ci/status/build/canceled_spec.rb
new file mode 100644
index 00000000000..c6b5cc68770
--- /dev/null
+++ b/spec/lib/gitlab/ci/status/build/canceled_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe Gitlab::Ci::Status::Build::Canceled 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 canceled' do
+ let(:build) { create(:ci_build, :canceled) }
+
+ it 'is a correct match' do
+ expect(subject).to be true
+ end
+ end
+
+ context 'when build is not canceled' do
+ let(:build) { create(:ci_build) }
+
+ it 'does not match' do
+ expect(subject).to be false
+ end
+ end
+ end
+end