This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require "faraday" | |
response = Faraday.get("http://127.0.0.1:8081/products") | |
raise "Test fallito" unless response.status == 200 | |
gotten = JSON.parse(response.body) | |
raise "Test fallito" unless gotten.has_key?("data") | |
raise "Test fallito" unless gotten["data"].is_a? Array | |
raise "Test fallito" unless gotten["data"][0].has_key?("type") |