bcms_webdav 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -99,7 +99,7 @@ This is an incomplete implementation of WebDAV, so many operations are not expli
99
99
 
100
100
  * All files are uploaded as 'FileBlocks', regardless of whether they are images or not.
101
101
  * All content_types are set to 'application/octet-stream' regardless of their actual type.
102
- * This m
102
+ * Links do not appear in the list of content items returned.
103
103
 
104
104
  === Performance
105
105
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -81,6 +81,7 @@ module Bcms
81
81
  child_nodes.each do |node|
82
82
  child_resources << child_node(node)
83
83
  end
84
+ child_resources.compact!
84
85
  return child_resources
85
86
  else
86
87
  []
@@ -176,7 +177,9 @@ module Bcms
176
177
  end
177
178
 
178
179
  def child_node(section_node)
179
- child_node = self.class.new(section_node.node.path, section_node.node.path, request, response, options.merge(:user => @user))
180
+ node_object = section_node.node
181
+ return nil if node_object && node_object.is_a?(Link)
182
+ child_node = self.class.new(node_object.path, node_object.path, request, response, options.merge(:user => @user))
180
183
  child_node.exist? # Force lookup of info from DB.
181
184
  child_node
182
185
  end
@@ -129,6 +129,22 @@ class WebDavSectionResourceTest < ActiveSupport::TestCase
129
129
  assert_equal 0, @resource.content_length
130
130
  end
131
131
 
132
+ test "links should not appear in the list, and should not be considered as resources" do
133
+
134
+ link = Link.new(:name=>'A', :url=>"www.google.com")
135
+ link.section = @about_us
136
+
137
+
138
+ assert_equal @about_us.id, link.section_id
139
+ assert_equal @about_us, link.section_node.section
140
+ assert_equal @about_us.id, link.section_node.section_id
141
+ link.save!
142
+
143
+ @resource = resource_for("/about-us")
144
+ assert_equal true, @resource.exist?
145
+ assert_equal 0, @resource.children.size
146
+
147
+ end
132
148
 
133
149
  private
134
150
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcms_webdav
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - BrowserMedia
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-01 00:00:00 -05:00
18
+ date: 2011-03-02 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency