Sha256: 909eb4a93085a622b64826b05bf4a101b02a3b3e48a3957994d2228a5712db6f
Contents?: true
Size: 816 Bytes
Versions: 6
Compression:
Stored size: 816 Bytes
Contents
require 'spec_helper' module OpenStax module Api describe RepresentableSchemaPrinter do it 'must print model schemas' do schema = RepresentableSchemaPrinter.json(DummyUserRepresenter) 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" } }, "additionalProperties" => false }) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems