From 002d84d8169886ab075b4091dc32edb050471730 Mon Sep 17 00:00:00 2001 From: Emil Kampp Date: Tue, 7 Jul 2015 20:21:43 +0200 Subject: [PATCH] Add test for OPTIONS and HEAD requests with catch-all This illustrates the issue described in #1056 by adding a options and head request when the catch-all route is enabled. --- spec/grape/api_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index 8033f1d931..d0515d3d23 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -2857,6 +2857,12 @@ def before get '/v2/hello' expect(last_response.status).to eq(200) expect(last_response.body).to eq('v2') + options '/v2/hello' + expect(last_response.status).to eq(200) + expect(last_response.body).to be_blank + head '/v2/hello' + expect(last_response.status).to eq(200) + expect(last_response.body).to be_blank get '/foobar' expect(last_response.status).to eq(404) expect(last_response.body).to eq('Unrecognized request path: foobar - /foobar')