Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate .rubocop_todo.yml #120

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-04-06 14:14:58 UTC using RuboCop version 1.62.1.
# on 2024-08-03 08:32:56 UTC using RuboCop version 1.65.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -49,6 +49,7 @@ Metrics/BlockLength:
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
- 'Rakefile.rb'
- 'lib/grape-swagger-rails.rb'
- 'spec/features/grape-swagger-rails_spec.rb'

Expand All @@ -61,7 +62,7 @@ RSpec/ContextWording:

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
Expand All @@ -70,14 +71,7 @@ RSpec/DescribedClass:
# Offense count: 6
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 8

# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/features/grape-swagger-rails_spec.rb'
Max: 12

# Offense count: 2
# Configuration parameters: AssignmentOnly.
Expand All @@ -87,7 +81,7 @@ RSpec/InstanceVariable:

# Offense count: 12
RSpec/MultipleExpectations:
Max: 4
Max: 6

# Offense count: 2
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 0.5.1 (Next)

* Your contribution here.

* [#120](https://github.com/ruby-grape/grape-swagger-rails/pull/120): Regenerate .rubocop_todo.yml - [@kakubin](https://github.com/kakubin).

### 0.5.0 (2024/04/06)

* [#110](https://github.com/ruby-grape/grape-swagger-rails/pull/110): Update dummy app to current rails conventions - [@duffn](https://github.com/duffn).
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ group :development, :test do
gem 'rubocop'
gem 'rubocop-capybara'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'rubocop-rspec', '>= 3.0.0'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'selenium-webdriver'
gem 'sprockets-rails', require: 'sprockets/railtie'
Expand Down
33 changes: 27 additions & 6 deletions spec/features/swagger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,26 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0')
expect(page).to have_css 'span.hljs-attr', text: 'x-test-header'
else
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
end
expect(page).to have_css 'span.hljs-string', text: 'Test Value'
end

it 'supports multiple headers' do
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0')
expect(page).to have_css 'span.hljs-attr', text: 'x-test-header'
expect(page).to have_css 'span.hljs-attr', text: 'x-another-header'
else
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header'
end
expect(page).to have_css 'span.hljs-string', text: 'Test Value'
expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header'
expect(page).to have_css 'span.hljs-string', text: 'Another Value'
end
end
Expand Down Expand Up @@ -108,7 +117,11 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0')
expect(page).to have_css 'span.hljs-attr', text: 'authorization'
else
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
end
expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}"
end
end
Expand All @@ -127,7 +140,11 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0')
expect(page).to have_css 'span.hljs-attr', text: 'authorization'
else
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
end
expect(page).to have_css 'span.hljs-string', text: 'Bearer token'
end
end
Expand All @@ -146,7 +163,11 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
if Gem::Version.new(Grape::VERSION) >= Gem::Version.new('2.0.0')
expect(page).to have_css 'span.hljs-attr', text: 'authorization'
else
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
end
expect(page).to have_css 'span.hljs-string', text: 'Token token'
end
end
Expand Down
Loading