Sha256: 5118dc95c9c177ec5ea1db7d4a8dd29e42508f0825d4261afcc94308cbca4f49
Contents?: true
Size: 582 Bytes
Versions: 11
Compression:
Stored size: 582 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe Grape::API do describe '.recognize_path' do subject { Class.new(Grape::API) } it 'fetches endpoint by given path' do subject.get('/foo/:id') {} subject.get('/bar/:id') {} subject.get('/baz/:id') {} actual = subject.recognize_path('/bar/1234').routes[0].origin expect(actual).to eq('/bar/:id') end it 'returns nil if given path does not match with registered routes' do subject.get {} expect(subject.recognize_path('/bar/1234')).to be_nil end end end
Version data entries
11 entries across 11 versions & 2 rubygems