test/node/test_entrance.rb in zold-0.13.43 vs test/node/test_entrance.rb in zold-0.13.44
- old
+ new
@@ -49,12 +49,20 @@
File.read(source.path)
end
FakeHome.new.run do |home|
source = home.create_wallet(sid)
home.create_wallet(tid)
- modified = Zold::Entrance.new(home.wallets, home.remotes, home.copies(source).root, 'x', log: test_log).push(
- source.id, body
- )
+ e = Zold::Entrance.new(home.wallets, home.remotes, home.copies(source).root, 'x', log: test_log)
+ modified = e.push(source.id, body)
assert_equal(2, modified.count)
+ end
+ end
+
+ def test_renders_json
+ FakeHome.new.run do |home|
+ wallet = home.create_wallet
+ e = Zold::Entrance.new(home.wallets, home.remotes, home.copies.root, 'x', log: test_log)
+ e.push(wallet.id, File.read(wallet.path))
+ assert(e.to_json[:history].include?(wallet.id.to_s))
end
end
end