-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathapi_test.mustache
47 lines (41 loc) · 1.25 KB
/
api_test.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
=begin
{{> api_info}}
=end
require 'spec_helper'
require 'json'
# Unit tests for {{moduleName}}::{{classname}}
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
{{#operations}}describe '{{classname}}' do
before do
# run before each test
@api_instance = {{moduleName}}::{{classname}}.new
end
after do
# run after each test
end
describe 'test an instance of {{classname}}' do
it 'should create an instance of {{classname}}' do
expect(@api_instance).to be_instance_of({{moduleName}}::{{classname}})
end
end
{{#operation}}
# unit tests for {{operationId}}
{{#summary}}
# {{.}}
{{/summary}}
{{#notes}}
# {{.}}
{{/notes}}
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
{{/required}}{{/allParams}} # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}]
describe '{{operationId}} test' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end
{{/operation}}
end
{{/operations}}