summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/serializers/build_entity.rb1
-rw-r--r--spec/serializers/build_entity_spec.rb8
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