spec/lib/batch_spec.rb in assimilate-0.0.5 vs spec/lib/batch_spec.rb in assimilate-0.1.0
- old
+ new
@@ -43,12 +43,12 @@
}
end
it "should load the records verbatim" do
@catalog.catalog.count.should == 6
- @catalog.where('_resource' => 'testdata', 'ID' => '3').should ==
- {'ID' => '3', 'name' => 'Benjamin Franklin', 'title' => 'Sage', 'spouse' => 'Deborah'}
+ franklin = @catalog.where('_resource' => 'testdata', 'ID' => '3')
+ franklin.keys.sort.should == ['ID', 'name', 'title', 'spouse', '_id', '_resource', '_first_seen'].sort
end
it "should refuse to do a duplicate import" do
lambda {import_data("123")}.should raise_error(Assimilate::DuplicateImportError, "duplicate batch for datestamp 123")
end
@@ -100,8 +100,9 @@
end
it "should handle deleted attributes" do
franklin = @catalog.where('ID' => '3')
franklin['spouse'].should be_nil
+ franklin['_last_updated'].should == '345'
end
end
end