Changeset 270
- Timestamp:
- 04/25/08 10:26:54 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/picolena/templates/app/models/document.rb
r269 r270 2 2 class Document 3 3 attr_reader :complete_path 4 attr_accessor : user, :score, :matching_content4 attr_accessor :score, :matching_content 5 5 6 6 def initialize(path) trunk/lib/picolena/templates/spec/models/document_spec.rb
r263 r270 2 2 3 3 basic_pdf_attribute={ 4 :size=>9380,5 4 :dirname=>File.join(RAILS_ROOT, 'spec/test_dirs/indexed/basic'), 6 5 :basename=>'basic', … … 34 33 } 35 34 36 it "should know which user it belongs to, if specified" do37 @valid_random_doc.should respond_to(:user)38 @valid_random_doc.user.should be_nil39 @valid_random_doc.user="eric"40 @valid_random_doc.user.should == "eric"41 end42 43 35 it "should know its content" do 44 36 another_doc=Document.new("spec/test_dirs/indexed/basic/plain.txt") trunk/lib/picolena/templates/spec/models/finder_spec.rb
r264 r270 73 73 matching_document_for("filetype:xyz").basename.should == "ghjopdfg" 74 74 matching_document_for("filetype:abc").filename.should == "asfg.abc" 75 matching_document_for("unreadable.png").size.should == 1969676 #Support for xls has been added meanwhile. The test is still valid though.77 matching_document_for("table.xls").size.should == 870478 75 end 79 76 … … 93 90 it "should find documents according to their utf8 content" do 94 91 matching_document_for("Ãric MöÃer ext:pdf").basename.should == "utf8" 95 matching_document_for("no me hace daño"). size.should == 3092 matching_document_for("no me hace daño").filename.should == "utf8.txt" 96 93 matching_document_for("Ãric MöÃer filetype:pdf").filename.should == "utf8.pdf" 97 94 end
