spec/i18n_spec.rb in grape-swagger-0.10.5 vs spec/i18n_spec.rb in grape-swagger-0.11.0

- old
+ new

@@ -162,31 +162,31 @@ api_index += 1 expect(result[:apis][api_index][:operations][0]).to include( summary: 'Finds user by id', notes: '' ) expect(result[:apis][api_index][:operations][0][:parameters]).to eq [ - { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false }, - { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false } + { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false }, + { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false } ] api_index += 1 expect(result[:apis][api_index][:operations][0]).to include( summary: "Changes a user's email", notes: '' ) expect(result[:apis][api_index][:operations][0][:parameters]).to eq [ - { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false }, { paramType: 'form', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false }, + { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false }, { paramType: 'form', name: 'email', description: 'A new email', type: 'string', required: true, allowMultiple: false } ] api_index += 1 expect(result[:apis][api_index][:operations][0]).to include( summary: "Gets the strength estimation of a user's password", notes: 'The estimation is done by a well-known algorithm when he changed his password' ) expect(result[:apis][api_index][:operations][0][:parameters]).to eq [ - { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false }, - { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false } + { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false }, + { paramType: 'path', name: 'id', description: 'User id', type: 'string', required: true, allowMultiple: false } ] end it 'translates swagger doc endpoints description, notes and params' do result = with_translations :en, api: api_translations do @@ -205,11 +205,11 @@ api_index += 1 expect(result[:apis][api_index][:operations][0]).to include( summary: 'Gets specific resource API document' ) expect(result[:apis][api_index][:operations][0][:parameters]).to eq [ - { paramType: 'path', name: 'name', description: 'Resource name', type: 'string', required: true, allowMultiple: false }, - { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false } + { paramType: 'query', name: 'locale', description: "Used to change locale of endpoint's responding message", type: 'string', required: false, allowMultiple: false }, + { paramType: 'path', name: 'name', description: 'Resource name', type: 'string', required: true, allowMultiple: false } ] end end describe 'I18n Customized Translation' do