From cba68d338bfac97baab153d38fa63b85a27f6d19 Mon Sep 17 00:00:00 2001 From: digitalMoksha Date: Tue, 21 Nov 2017 13:29:57 +0100 Subject: use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers` since `Rails.application.routes.url_helpers` creates a new anonymous module every time it's called --- spec/lib/gitlab/middleware/read_only_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/lib/gitlab/middleware/read_only_spec.rb b/spec/lib/gitlab/middleware/read_only_spec.rb index 044b93f0120..07ba11b93a3 100644 --- a/spec/lib/gitlab/middleware/read_only_spec.rb +++ b/spec/lib/gitlab/middleware/read_only_spec.rb @@ -91,6 +91,12 @@ describe Gitlab::Middleware::ReadOnly do expect(subject).to disallow_request end + it 'returns last_vistited_url for disallowed request' do + response = request.post('/test_request') + + expect(response.location).to eq 'http://localhost/' + end + context 'whitelisted requests' do it 'expects a POST internal request to be allowed' do expect(Rails.application.routes).not_to receive(:recognize_path) -- cgit v1.2.1