summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 14:22:19 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 14:22:19 +0100
commita68e7e605aa684e88523f6e28f995c3b497945c6 (patch)
treeec8c161ed0fac30496c304d7abb7d8eaf3e76d8e /spec
parent6c94adea3541914e7c36fb2e36a0f3ee44d2bcb4 (diff)
downloadgitlab-ce-a68e7e605aa684e88523f6e28f995c3b497945c6.tar.gz
Add basic tests for build entity used by serialzier
Diffstat (limited to 'spec')
-rw-r--r--spec/serializers/build_entity_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/serializers/build_entity_spec.rb b/spec/serializers/build_entity_spec.rb
new file mode 100644
index 00000000000..b7acc2066ba
--- /dev/null
+++ b/spec/serializers/build_entity_spec.rb
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe BuildEntity do
+ subject do
+ described_class.new(build, request: double).as_json
+ end
+
+ context 'when build is a regular job' do
+ let(:build) { create(:ci_build) }
+
+ it 'contains url to build page and retry action' do
+ expect(subject).to include(:build_url, :retry_url)
+ expect(subject).not_to include(:play_url)
+ end
+ end
+
+ context 'when build is a manual action' do
+ let(:build) { create(:ci_build, :manual) }
+
+ it 'contains url to play action' do
+ expect(subject).to include(:play_url)
+ end
+ end
+end