Return live and dead properties for allprop

This commit is contained in:
Brandon Robins
2018-01-31 22:18:43 -06:00
parent 9f21799206
commit 714901023e
2 changed files with 12 additions and 1 deletions

View File

@@ -552,6 +552,10 @@ module Calligraphy
properties[node.name.to_sym] = node properties[node.name.to_sym] = node
end end
(DAV_PROPERTY_METHODS - %w[allprop propname]).each do |property|
properties[property.to_sym] = send property, xml_node(property)
end
end end
end end

View File

@@ -31,16 +31,23 @@ RSpec.describe 'PROPFIND', type: :request do
end end
describe 'allprop' do describe 'allprop' do
it 'returns all property names and values' do it 'returns all live and dead properties' do
propfind '/webdav/bar.html', headers: { propfind '/webdav/bar.html', headers: {
RAW_POST_DATA: Support::Examples::Propfind.allprop RAW_POST_DATA: Support::Examples::Propfind.allprop
} }
property_methods = Calligraphy::FileResource::DAV_PROPERTY_METHODS -
%w[allprop propname]
expect(response.status).to eq(207) expect(response.status).to eq(207)
expect(response.body).to include('Authors') expect(response.body).to include('Authors')
expect(response.body).to include('Author>') expect(response.body).to include('Author>')
expect(response.body).to include('Jim') expect(response.body).to include('Jim')
expect(response.body).to include('Roy') expect(response.body).to include('Roy')
property_methods.each do |property_method|
expect(response.body).to include(property_method)
end
end end
end end