test/node/test_front.rb in zold-0.10.12 vs test/node/test_front.rb in zold-0.10.13
- old
+ new
@@ -17,22 +17,19 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
require 'minitest/autorun'
-require 'tmpdir'
-require_relative '../../lib/zold/key'
-require_relative '../../lib/zold/id'
-require_relative '../../lib/zold/log'
-require_relative '../../lib/zold/amount'
-require_relative '../../lib/zold/wallet'
-require_relative '../../lib/zold/http'
+require 'json'
+require_relative '../test__helper'
require_relative 'fake_node'
+require_relative '../../lib/zold/http'
+require_relative '../../lib/zold/score'
class FrontTest < Minitest::Test
def test_renders_public_pages
- FakeNode.new.run do |port|
+ FakeNode.new(log: $log).run(['--ignore-score-weakness']) do |port|
{
'200' => [
'/robots.txt',
'/',
'/map.html',
@@ -50,8 +47,16 @@
code, response.code,
"Invalid response code for #{uri}: #{response.message}"
)
end
end
+ score = Zold::Score.new(
+ Time.now, 'localhost', 999,
+ 'NOPREFIX@ffffffffffffffff',
+ strength: 1
+ ).next.next.next.next
+ Zold::Http.new(URI("http://localhost:#{port}/"), score).get
+ json = JSON.parse(Zold::Http.new(URI("http://localhost:#{port}/remotes"), score).get.body)
+ assert(json['all'].find { |r| r['host'] == 'localhost' })
end
end
end