I added to my gemfile:
gem 'rswag'
group :test do
gem 'rspec-rails', '~> 3.5'
end
and created a test file spec/integration/my_api_spec.rb
where I put the default pet test present in the README file of rswag, but when I run
bundle exec rake rswag:specs:swaggerize
I get this error:
```An error occurred while loading ./spec/integration/my_api_spec.rb.
Failure/Error: tag 'Create Tag'
NoMethodError:
undefined method 'tag' for RSpec::ExampleGroups::MyAPI::ApiMy:Class
if I remove the tag I get
An error occurred while loading ./spec/integration/my_api_spec.rb.
Failure/Error: consumes 'application/json'
NoMethodError:
undefined method '[]=' for nil:NilClass
The test file includes ```require 'swagger_helper'``` which containes the following:
require 'rails_helper'
RSpec.configure do |config|
config.swagger_root = Rails.root.to_s + '/swagger'
config.swagger_docs = {
'v1/swagger.json' => {
swagger: '2.0',
info: {
title: 'API V1',
version: 'v1'
},
paths: {}
}
}
end
```
Can you post the my_api_spec.rb file?
I am facing the same issue.
This error occurs when you use tag 'foo' inside of your spec, instead of tags 'foo'. It's supposed to be plural tags
Sorry for the late response, I will try this and post the file if it still fails
Most helpful comment
I am facing the same issue.