From 45b67f4ca62d8dda0b2f3aaac63a637b1851de43 Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Wed, 30 Nov 2016 15:23:36 +0100 Subject: [PATCH] An attempt to create a folder in the root causes an infinite loop #616 --- test/integration/dmsf_webdav_options_test.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/integration/dmsf_webdav_options_test.rb b/test/integration/dmsf_webdav_options_test.rb index 0d0a140b..76b9d3f0 100644 --- a/test/integration/dmsf_webdav_options_test.rb +++ b/test/integration/dmsf_webdav_options_test.rb @@ -46,11 +46,20 @@ class DmsfWebdavOptionsTest < RedmineDmsf::Test::IntegrationTest end def test_options_returns_expected_allow_header + Setting.plugin_redmine_dmsf['dmsf_webdav_strategy'] = 'WEBDAV_READ_ONLY' xml_http_request :options, '/dmsf/webdav' assert_response :success assert !(response.headers.nil? || response.headers.empty?), 'Response headers are empty' assert response.headers['Allow'] , 'Allow header is empty or does not exist' - assert response.headers['Allow'] == 'OPTIONS,HEAD,GET,PUT,POST,DELETE,PROPFIND,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK', 'Allow header returns expected content' + assert response.headers['Allow'] == 'OPTIONS,HEAD,GET,PROPFIND', 'Allow header returns expected content' + end + + def test_options_returns_expected_allow_header_for_ro + xml_http_request :options, '/dmsf/webdav' + assert_response :success + assert !(response.headers.nil? || response.headers.empty?), 'Response headers are empty' + assert response.headers['Allow'] , 'Allow header is empty or does not exist' + assert response.headers['Allow'] == 'OPTIONS,HEAD,GET,PROPFIND,PUT,POST,DELETE,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK', 'Allow header returns expected content' end def test_options_returns_expected_dav_header @@ -99,7 +108,7 @@ class DmsfWebdavOptionsTest < RedmineDmsf::Test::IntegrationTest assert_response :success assert !(response.headers.nil? || response.headers.empty?), "Response headers are empty" assert response.headers['Allow'], 'Allow header is empty or does not exist' - assert response.headers['Allow'] == 'OPTIONS,HEAD,GET,PUT,POST,DELETE,PROPFIND,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK', 'Allow header returns expected' + assert response.headers['Allow'] == 'OPTIONS,HEAD,GET,PROPFIND,PUT,POST,DELETE,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK', 'Allow header returns expected' end def test_authenticated_options_returns_expected_dav_header