Skip to content

Commit

Permalink
Test new conditional branch in Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordnibbler committed Aug 1, 2016
1 parent 32bbbcf commit ed09287
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/grape-swagger/entity/parser_spec.rb
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

0 comments on commit ed09287

Please sign in to comment.