Skip to content

Commit 3971c76

Browse files
committed
Skip empty entity tests for grape-swagger < 2.1.3
grape-swagger < 2.1.3 doesn't support empty model definitions. Support was added in grape-swagger PR #963 which will be released in version 2.1.3. Tests are skipped for older versions.
1 parent 7566ddb commit 3971c76

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#### Fixes
88

99
* Your contribution here.
10-
* [#86](https://github.com/ruby-grape/grape-swagger-entity/pull/86): Fix properly parse custom array documentation - [@numbata](https://github.com/numbata).
10+
* [#86](https://github.com/ruby-grape/grape-swagger-entity/pull/86): Fix Array[Object] documentation type parsing - [@numbata](https://github.com/numbata).
1111
* [#87](https://github.com/ruby-grape/grape-swagger-entity/pull/87): Remove hidden attributes from required - [@bogdan](https://github.com/bogdan).
1212
* [#88](https://github.com/ruby-grape/grape-swagger-entity/pull/88): Update danger workflows - [@numbata](https://github.com/numbata).
1313
* [#89](https://github.com/ruby-grape/grape-swagger-entity/pull/89): Remove ruby-grape-danger - [@dblock](https://github.com/dblock).

spec/issues/962_polymorphic_entity_with_custom_documentation_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# frozen_string_literal: true
22

33
describe '#962 empty entity with custom documentation type' do
4+
# grape-swagger < 2.1.3 doesn't support empty model definitions (PR #963)
5+
let(:supports_empty_models?) { Gem::Version.new(GrapeSwagger::VERSION) >= Gem::Version.new('2.1.3') }
6+
47
context 'when entity has no properties' do
58
subject(:swagger_doc) do
69
get '/swagger_doc'
710
JSON.parse(last_response.body)
811
end
912

13+
before { skip 'grape-swagger < 2.1.0 does not support empty models' unless supports_empty_models? }
14+
1015
let(:app) do
1116
Class.new(Grape::API) do
1217
namespace :issue962 do
@@ -65,6 +70,8 @@ class Report < Grape::Entity
6570
JSON.parse(last_response.body)
6671
end
6772

73+
before { skip 'grape-swagger < 2.1.0 does not support empty models' unless supports_empty_models? }
74+
6875
let(:app) do
6976
Class.new(Grape::API) do
7077
namespace :issue962 do

0 commit comments

Comments
 (0)