summaryrefslogtreecommitdiff
path: root/app/serializers/test_suite_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/test_suite_entity.rb')
-rw-r--r--app/serializers/test_suite_entity.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/serializers/test_suite_entity.rb b/app/serializers/test_suite_entity.rb
index 53fa830718a..d04fd5f6a84 100644
--- a/app/serializers/test_suite_entity.rb
+++ b/app/serializers/test_suite_entity.rb
@@ -9,9 +9,11 @@ class TestSuiteEntity < Grape::Entity
expose :failed_count
expose :skipped_count
expose :error_count
- expose :suite_error
- expose :test_cases, using: TestCaseEntity do |test_suite|
- test_suite.suite_error ? [] : test_suite.test_cases.values.flat_map(&:values)
+ with_options if: -> (_, opts) { opts[:details] } do |test_suite|
+ expose :suite_error
+ expose :test_cases, using: TestCaseEntity do |test_suite|
+ test_suite.suite_error ? [] : test_suite.test_cases.values.flat_map(&:values)
+ end
end
end