From 5555edc59fa3bb6074810e1a5687411847f9f734 Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Mon, 26 Aug 2019 22:25:53 -0400 Subject: [PATCH 1/5] Only automatically save examples if examples are not given explicitly in the spec itself --- rswag-specs/lib/open_api/rswag/specs/example_group_helpers.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rswag-specs/lib/open_api/rswag/specs/example_group_helpers.rb b/rswag-specs/lib/open_api/rswag/specs/example_group_helpers.rb index 58fc489..b0efcbe 100644 --- a/rswag-specs/lib/open_api/rswag/specs/example_group_helpers.rb +++ b/rswag-specs/lib/open_api/rswag/specs/example_group_helpers.rb @@ -238,7 +238,9 @@ module OpenApi if body_parameter && respond_to?(body_parameter[:name]) && example.metadata[:operation][:requestBody][:content]['application/json'] # save response examples by default - example.metadata[:response][:examples] = { 'application/json' => JSON.parse(response.body, symbolize_names: true) } unless response.body.to_s.empty? + if example.metadata[:response][:examples].nil? || example.metadata[:response][:examples].empty? + example.metadata[:response][:examples] = { 'application/json' => JSON.parse(response.body, symbolize_names: true) } unless response.body.to_s.empty? + end # save request examples using the let(:param_name) { REQUEST_BODY_HASH } syntax in the test if response.code.to_s =~ /^2\d{2}$/ From 02f72a4b1afbede1b688e32d3a694de9cb4a80d6 Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Mon, 26 Aug 2019 22:39:13 -0400 Subject: [PATCH 2/5] Trying to fix capybara --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1a2734d..04b2884 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,12 @@ cache: directories: - /home/travis/.rvm/gems/ruby-2.5.1 +addons: + apt: + packages: + - libqtwebkit-dev + - libqtwebkit4 + install: ./ci/build.sh before_script: From 90af919af38fb19221919c70288b921c3e45db99 Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Mon, 26 Aug 2019 22:46:30 -0400 Subject: [PATCH 3/5] Removes startup script trying to get travis build to work --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 04b2884..2c05300 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ install: ./ci/build.sh before_script: - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - sleep 3 script: ./ci/test.sh From 91ae7732c2909381f1f667964bd2fa38f6bc2602 Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Mon, 26 Aug 2019 22:57:05 -0400 Subject: [PATCH 4/5] Adding services startup for travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2c05300..6655410 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,9 @@ addons: install: ./ci/build.sh +services: +- xvfb + before_script: - export DISPLAY=:99.0 - sleep 3 From 4670dcd4b092e6833cf5a82f5fc6008bdb386725 Mon Sep 17 00:00:00 2001 From: Jay Danielian Date: Mon, 26 Aug 2019 23:01:38 -0400 Subject: [PATCH 5/5] Removes rails 4.2.8 due to bundler conflicts --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6655410..d050941 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ rvm: env: - RAILS_VERSION=5.2.0 - - RAILS_VERSION=4.2.8 + # - RAILS_VERSION=4.2.8 cache: directories: