From cfe2f4d6e265cdf900d2149fea2909f4ca7e46cd Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 28 Nov 2016 13:02:58 +0100 Subject: Expose `manual` field in build entity for serializers --- app/serializers/build_entity.rb | 1 + spec/serializers/build_entity_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/serializers/build_entity.rb b/app/serializers/build_entity.rb index cf1c418a88e..4a3f6fa04a5 100644 --- a/app/serializers/build_entity.rb +++ b/app/serializers/build_entity.rb @@ -3,6 +3,7 @@ class BuildEntity < Grape::Entity expose :id expose :name + expose :manual?, as: :manual expose :build_path do |build| path_to(:namespace_project_build, build) diff --git a/spec/serializers/build_entity_spec.rb b/spec/serializers/build_entity_spec.rb index 6dcfaec259e..1297f8a99b1 100644 --- a/spec/serializers/build_entity_spec.rb +++ b/spec/serializers/build_entity_spec.rb @@ -19,6 +19,10 @@ describe BuildEntity do expect(subject).not_to include(/token/) expect(subject).not_to include(/variables/) end + + it 'contains field which says it is not a manual job' do + expect(subject.fetch(:manual)).to be false + end end context 'when build is a manual action' do @@ -27,5 +31,9 @@ describe BuildEntity do it 'contains path to play action' do expect(subject).to include(:play_path) end + + it 'contains field which says it is manual job' do + expect(subject.fetch(:manual)).to be true + end end end -- cgit v1.2.1