|
|
|
@ -57,14 +57,14 @@ class ManifestTest < MiniTest::Spec
|
|
|
|
|
|
|
|
|
|
context "when the doc has a meta file" do
|
|
|
|
|
before do
|
|
|
|
|
stub(store).exist?("testdoc/db.json") { false }
|
|
|
|
|
stub(store).exist?(meta_path) { true }
|
|
|
|
|
stub(store).read(meta_path) { '{"name":"Test", "db_size": 776533}' }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it "includes the doc's meta representation" do
|
|
|
|
|
json = manifest.as_json
|
|
|
|
|
assert_equal 1, json.length
|
|
|
|
|
assert_equal "{:name=>\"TestDoc\", :slug=>\"testdoc\", :type=>nil, :attribution=>\"foo\", :mtime=>0}", json[0].to_s
|
|
|
|
|
assert_equal "{\"name\"=>\"Test\", \"db_size\"=>776533, :attribution=>\"foo\"}", json[0].to_s
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|