Skip to content

Commit f5dd77c

Browse files
author
Tim Vandecasteele
committed
Rename @api back to desc.
1 parent 89c8a9f commit f5dd77c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

spec/grape-swagger-helper_spec.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,62 @@ class HelperTestAPI < Grape::API
99

1010
@api = Object.new
1111
# after injecting grape-swagger into the Test API we get the helper methods
12-
# back from the first endpoint's class (the API mounted by grape-swagger
12+
# back from the first endpoint's class (the API mounted by grape-swagger
1313
# to serve the swagger_doc
1414
@api.extend HelperTestAPI.endpoints.first.options[:app].helpers
1515

1616
end
17-
17+
1818
context "parsing parameters" do
1919
it "should parse params as query strings for a GET" do
2020
params = {
21-
name: {type: 'String', :@api => "A name", required: true },
22-
level: 'max'
21+
name: {type: 'String', :desc => "A name", required: true },
22+
level: 'max'
2323
}
2424
path = "/coolness"
2525
method = "GET"
26-
@api.parse_params(params, path, method).should ==
27-
[
26+
@api.parse_params(params, path, method).should ==
27+
[
2828
{paramType: "query", name: :name, description:"A name", dataType: "String", required: true},
2929
{paramType: "query", name: :level, description:"", dataType: "String", required: false}
3030
]
3131
end
32-
32+
3333
it "should parse params as body for a POST" do
3434
params = {
35-
name: {type: 'String', :@api =>"A name", required: true },
36-
level: 'max'
35+
name: {type: 'String', :desc =>"A name", required: true },
36+
level: 'max'
3737
}
3838
path = "/coolness"
3939
method = "POST"
40-
@api.parse_params(params, path, method).should ==
41-
[
40+
@api.parse_params(params, path, method).should ==
41+
[
4242
{paramType: "body", name: :name, description:"A name", dataType: "String", required: true},
4343
{paramType: "body", name: :level, description:"", dataType: "String", required: false}
4444
]
4545
end
4646
end
47-
47+
4848
context "parsing the path" do
4949
it "should parse the path" do
5050
path = ":abc/def(.:format)"
5151
@api.parse_path(path, nil).should == "{abc}/def.{format}"
5252
end
53-
53+
5454
it "should parse the path with a specified version" do
5555
path = ":abc/{version}/def(.:format)"
5656
@api.parse_path(path, 'v1').should == "{abc}/v1/def.{format}"
5757
end
5858
end
59-
59+
6060
context "parsing header parameters" do
6161
it "should parse params for the header" do
6262
params = {"XAuthToken" => { description: "A required header.", required: true}}
63-
@api.parse_header_params(params).should ==
64-
[
63+
@api.parse_header_params(params).should ==
64+
[
6565
{paramType: "header", name: "XAuthToken", description:"A required header.", dataType: "String", required: true}
6666
]
6767
end
6868
end
69-
70-
end
69+
70+
end

0 commit comments

Comments
 (0)