-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test new conditional branch in Parser
- Loading branch information
1 parent
32bbbcf
commit ed09287
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'spec_helper' | ||
require_relative '../../../spec/support/shared_contexts/this_api' | ||
|
||
describe GrapeSwagger::Entity::Parser do | ||
include_context 'this api' | ||
|
||
describe '#call' do | ||
subject(:parsed_entity) { described_class.new(ThisApi::Entities::Something, endpoint).call } | ||
|
||
context 'when no endpoint is passed' do | ||
let(:endpoint) { nil } | ||
|
||
it 'parses the model with the correct :using definition' do | ||
expect(parsed_entity[:kind]['$ref']).to eq('#/definitions/Kind') | ||
expect(parsed_entity[:kind2]['$ref']).to eq('#/definitions/Kind') | ||
expect(parsed_entity[:kind3]['$ref']).to eq('#/definitions/Kind') | ||
end | ||
end | ||
end | ||
end |