@@ -26,9 +26,8 @@ def app; SimpleApiWithBasePath end
26
26
end
27
27
28
28
it "retrieves the same given base-path for mounted-api" do
29
- Random . stub ( :rand ) { 0 }
30
29
get '/swagger_doc/something'
31
- last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" #{ SimpleApiWithBasePath ::NON_DEFAULT_BASE_PATH } \" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>0 , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
30
+ last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" #{ SimpleApiWithBasePath ::NON_DEFAULT_BASE_PATH } \" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>\" GET-something---format- \" , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
32
31
end
33
32
end
34
33
@@ -57,9 +56,8 @@ def app; SimpleApiWithApiVersion end
57
56
end
58
57
59
58
it "retrieves the same api version for mounted-api" do
60
- Random . stub ( :rand ) { 0 }
61
59
get '/swagger_doc/something'
62
- last_response . body . should == "{:apiVersion=>\" #{ SimpleApiWithApiVersion ::API_VERSION } \" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>0 , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
60
+ last_response . body . should == "{:apiVersion=>\" #{ SimpleApiWithApiVersion ::API_VERSION } \" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>\" GET-something---format- \" , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
63
61
end
64
62
end
65
63
@@ -88,9 +86,8 @@ def app; SimpleApiWithDifferentMount end
88
86
end
89
87
90
88
it "retrieves the same given base-path for mounted-api" do
91
- Random . stub ( :rand ) { 0 }
92
89
get '/api_doc/something'
93
- last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>0 , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
90
+ last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>nil, :summary=>\" this gets something\" , :nickname=>\" GET-something---format- \" , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
94
91
end
95
92
96
93
it "does not respond to swagger_doc" do
@@ -119,9 +116,8 @@ class SimpleApiWithMarkdown < Grape::API
119
116
def app ; SimpleApiWithMarkdown end
120
117
121
118
it "parses markdown for a mounted-api" do
122
- Random . stub ( :rand ) { 0 }
123
119
get '/swagger_doc/something'
124
- last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>\" <p><em>test</em></p>\\ n\" , :summary=>\" this gets something\" , :nickname=>0 , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
120
+ last_response . body . should == "{:apiVersion=>\" 0.1\" , :swaggerVersion=>\" 1.1\" , :basePath=>\" http://example.org\" , :resourcePath=>\" \" , :apis=>[{:path=>\" /something.{format}\" , :operations=>[{:notes=>\" <p><em>test</em></p>\\ n\" , :summary=>\" this gets something\" , :nickname=>\" GET-something---format- \" , :httpMethod=>\" GET\" , :parameters=>[]}]}]}"
125
121
end
126
122
end
127
123
0 commit comments