spec/unit/document_spec.rb in om-1.2.5 vs spec/unit/document_spec.rb in om-1.3.0

- old
+ new

@@ -145,7 +145,19 @@ it "should support xpath queries as the pointer" do @mods_article.find_by_terms('//oxns:name[@type="personal"][1]/oxns:namePart[1]').first.text.should == "FAMILY NAME" end end + + describe "node_exists?" do + it "should return true if any nodes are found" do + @mods_article.node_exists?( {:person=>1}, :first_name).should be_true + end + it "should return false if no nodes are found" do + @mods_article.node_exists?( {:person=>8}, :first_name ).should be_false + end + it "should support xpath queries" do + @mods_article.node_exists?('//oxns:name[@type="personal"][1]/oxns:namePart[1]').should be_true + end + end end \ No newline at end of file