File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 7979 expect ( rendered ) . to have_css ( "div#server-list>p>strong" , text : "Development" )
8080 expect ( rendered ) . to have_css ( "div#server-list>p>strong>p>em" , text : "Development" )
8181 end
82+
83+ it "renders a schema" do
84+ @spec [ "components" ] = {
85+ "schemas" : {
86+ "Pet" : {
87+ "properties" : {
88+ "id" : { "type" : "integer" , "format" : "int64" } ,
89+ } ,
90+ } ,
91+ } ,
92+ }
93+ document = Openapi3Parser . load ( @spec )
94+
95+ render = described_class . new ( @app , document )
96+ rendered = render . api_full ( document . info , document . servers )
97+
98+ rendered = Capybara ::Node ::Simple . new ( rendered )
99+ expect ( rendered ) . to have_css ( "h2#schemas" , text : "Schemas" )
100+ expect ( rendered ) . to have_css ( "h3#schema-pet" , text : "Pet" )
101+ expect ( rendered ) . to have_css ( "table.schema-pet" , text : "id" )
102+ end
82103 end
83104end
You can’t perform that action at this time.
0 commit comments