Sha256: 0d79ce623aa7e073ef506b09764935edcac6659c0cd3aa6b35785f982ce520e3
Contents?: true
Size: 755 Bytes
Versions: 1
Compression:
Stored size: 755 Bytes
Contents
require 'spec_helper' describe GrapeRouteHelpers::AllRoutes do Grape::API.extend described_class describe '#all_routes' do context 'when API is mounted within another API' do let(:mounting_api) { Spec::Support::RouteMatcherHelpers.mounting_api } it 'does not include the same route twice' do mounting_api # A route is unique if no other route shares the same set of options all_route_options = Grape::API.all_routes.map do |r| r.instance_variable_get(:@options) end duplicates = all_route_options.select do |o| all_route_options.count(o) > 1 end expect(duplicates).to be_empty expect(all_route_options.size).to eq(5) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
grape-route-helpers-1.2.0 | spec/grape_route_helpers/all_routes.rb |