Sha256: 1dd5bbd1cfc2390c58aac865c9953e1ad7ffc0ebbd0b5d54db2fc318b8c2a964

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path("../../spec_helper", __FILE__)

module Rews
  describe Shape do
    describe Shape::FolderShape do
      it "should write FolderShape xml" do
        xml = Shape::FolderShape.new(:base_shape=>:IdOnly,
                                     :additional_properties=>[[:field_uri, "folder:FolderId"],
                                                              [:field_uri, "folder:TotalCount"]]).to_xml

        doc = Nokogiri::XML(xml)
        fs = doc.children.first
        fs.name.should == "FolderShape"
        fs.children.size.should == 2

        bs = fs.children.first
        bs.name.should == "BaseShape"
        bs.content.should == "IdOnly"

        ap = fs.children[1]
        ap.name.should == "AdditionalProperties"
        ap.children.size.should == 2

        fid = ap.children.first
        fid.name.should == "FieldURI"
        fid[:FieldURI].should == "folder:FolderId"
        fid.children.size.should == 0

        ftot = ap.children[1]
        ftot.name.should == "FieldURI"
        ftot[:FieldURI].should == "folder:TotalCount"
        ftot.children.size.should == 0
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rews-0.5.5 spec/rews/shape_spec.rb
rews-0.5.4 spec/rews/shape_spec.rb
rews-0.5.3 spec/rews/shape_spec.rb
rews-0.5.1 spec/rews/shape_spec.rb
rews-0.5.0 spec/rews/shape_spec.rb
rews-0.2.12 spec/rews/shape_spec.rb
rews-0.2.11 spec/rews/shape_spec.rb
rews-0.2.10 spec/rews/shape_spec.rb
rews-0.2.9 spec/rews/shape_spec.rb
rews-0.2.7 spec/rews/shape_spec.rb
rews-0.2.6 spec/rews/shape_spec.rb
rews-0.2.5 spec/rews/shape_spec.rb
rews-0.2.4 spec/rews/shape_spec.rb
rews-0.2.3 spec/rews/shape_spec.rb
rews-0.2.2 spec/rews/shape_spec.rb
rews-0.2.1 spec/rews/shape_spec.rb
rews-0.2.0 spec/rews/shape_spec.rb