Sha256: 7f759668c0d1df2ed6a7d474c6ec30b4d851a53049723a3bd267c57199953e92
Contents?: true
Size: 551 Bytes
Versions: 20
Compression:
Stored size: 551 Bytes
Contents
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
20 entries across 20 versions & 2 rubygems