Skip to content

Commit

Permalink
ruby-grape#91 Reduce regression spec to failing part of JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
davetapley committed Jul 15, 2014
1 parent c18719f commit bdae185
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions spec/form_params_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,11 @@ def app
it 'retrieves the documentation for group parameters' do
get '/swagger_doc/groups.json'

JSON.parse(last_response.body).should == {
'apiVersion' => '0.1',
'swaggerVersion' => '1.2',
'resourcePath' => '/groups',
'basePath' => 'http://example.org',
'produces' => ['application/json'],
'apis' => [
{
'path' => '/groups.{format}',
'operations' => [
{
'notes' => '',
'summary' => '',
'nickname' => 'POST-groups---format-',
'method' => 'POST',
'parameters' => [
{ 'paramType' => 'form', 'name' => 'required_group[required_param_1]', 'description' => nil, 'type' => 'string', 'required' => true, 'allowMultiple' => false },
{ 'paramType' => 'form', 'name' => 'required_group[required_param_2]', 'description' => nil, 'type' => 'string', 'required' => true, 'allowMultiple' => false }],
'type' => 'void'
}
]
}
]
}
body = JSON.parse last_response.body
parameters = body['apis'].first['operations'].first['parameters']
parameters.should == [
{ 'paramType' => 'form', 'name' => 'required_group[required_param_1]', 'description' => nil, 'type' => 'string', 'required' => true, 'allowMultiple' => false },
{ 'paramType' => 'form', 'name' => 'required_group[required_param_2]', 'description' => nil, 'type' => 'string', 'required' => true, 'allowMultiple' => false }]

end
end

0 comments on commit bdae185

Please sign in to comment.