diff options
author | digitalMoksha <bwalker@gitlab.com> | 2017-11-21 13:29:57 +0100 |
---|---|---|
committer | digitalMoksha <bwalker@gitlab.com> | 2017-11-21 13:29:57 +0100 |
commit | cba68d338bfac97baab153d38fa63b85a27f6d19 (patch) | |
tree | de944b269071ff7b75970e84783b80d4095e58a4 /spec | |
parent | 3c52e2f06ef3234ab5ace532e21e194abab96b59 (diff) | |
download | gitlab-ce-cba68d338bfac97baab153d38fa63b85a27f6d19.tar.gz |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/middleware/read_only_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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) |