Skip to content

Commit 6c874e3

Browse files
committed
Mimic Repos route matching logic in unit test
This spec is really testing Sinatra's routing logic rather than our software, so it feels like like a superfluous test. While we decide what to do with it, we mimic the routing logic here to preserve the previous specs.
1 parent 319c5ff commit 6c874e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/unit/endpoint/repos_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
context 'correctly capture params' do
55
before do
6-
described_class.get('/spec/match/:id') { "id" }
7-
described_class.get('/spec/match/:name') { "name" }
6+
described_class.get('/spec/match/((?<id>\d+)|(?<owner_name>[^\/]+))', mustermann_opts: { type: :regexp }) do
7+
params[:id] ? "id" : "name"
8+
end
89
end
910

1011
it 'matches :id with digits' do

0 commit comments

Comments
 (0)