Sha256: f0b0bcf0e2d8b1d94c5cbbd7fd86731dc39a58d9ba53ba473d8bd57abce3fd9c
Contents?: true
Size: 909 Bytes
Versions: 47
Compression:
Stored size: 909 Bytes
Contents
require 'rails_helper' module OpenStax module Api describe RepresentableSchemaPrinter do it 'must print model schemas' do schema = RepresentableSchemaPrinter.json(UserRepresenter) expect(schema).to include('## Schema') expect(schema).to include('{#') expect(schema).to include(' .schema}') expect(schema).to include("<pre class='code'>") expect(schema).to include('</pre>') json_schema = schema.match(/<pre class='code'>([^<]*)<\/pre>/) expect(JSON.parse(json_schema[1])).to eq({ "type" => "object", "required" => [ "username" ], "properties" => { "username" => { "type" => "string" }, "name" => { "type" => "string" }, "email" => { "type" => "string" } }, "additionalProperties" => false }) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems