diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-28 13:02:58 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-28 13:02:58 +0100 |
commit | cfe2f4d6e265cdf900d2149fea2909f4ca7e46cd (patch) | |
tree | b0e9145c58c5147d0509207a61f7b6b802a6e5cc | |
parent | 333e83a2ef29a0fce10b3e1b0110cd30685eea15 (diff) | |
download | gitlab-ce-feature/expose-manual-field-in-build-entity.tar.gz |
Expose `manual` field in build entity for serializersfeature/expose-manual-field-in-build-entity
-rw-r--r-- | app/serializers/build_entity.rb | 1 | ||||
-rw-r--r-- | spec/serializers/build_entity_spec.rb | 8 |
2 files changed, 9 insertions, 0 deletions
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 |