test/document_test.rb in mattly-exegesis-0.2.5 vs test/document_test.rb in mattly-exegesis-0.2.6
- old
+ new
@@ -120,11 +120,11 @@
before do
reset_db
end
describe "updating attributes" do
-
+
describe "an existing doc" do
before do
@doc = TestDocument.new({'foo' => 'bar'}, @db)
@doc.save
@old_rev = @doc.rev
@@ -167,9 +167,20 @@
end
describe "with a non blank rev" do
before { @action = lambda{@doc.update_attributes({'foo'=>'baz', '_rev'=>'1-3034523523'})} }
expect { @action.must_raise ArgumentError }
end
+ end
+
+ describe "with attachments" do
+ before do
+ @doc = TestDocument.new({}, @db)
+ @doc.update_attributes({'_attachments' =>
+ {'file.txt' => {'content_type' => 'text/plain', 'stub' => true}}
+ })
+ end
+
+ expect {@doc.attachments['file.txt'].must_be_instance_of(Exegesis::Document::Attachment) }
end
end
end