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

Add support single quoted string and percent string and heredoc for RSpec/Rails/HttpStatus #1725

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

ydah
Copy link
Member

@ydah ydah commented Sep 21, 2023

This PR add support single quoted string and percent string and heredoc for RSpec/Rails/HttpStatus.

reproduction code

it { is_expected.to have_http_status '200' }
it { is_expected.to have_http_status %[200] }
it { is_expected.to have_http_status <<~HTTP }
  200
HTTP

expected

it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status <<~HTTP } # not offense
  200
HTTP

actual

it { is_expected.to have_http_status }
it { is_expected.to have_http_status }
it { is_expected.to have_http_status }
  200
HTTP

@ydah ydah force-pushed the fix-incorrect-autocorrect-httpstatus branch from 470af75 to 6deb770 Compare September 21, 2023 16:47
@ydah ydah changed the title Fix an incorrect autocorrect for RSpec/Rails/HttpStatus when single quoted string value Add support single quoted string and percent string and heredoc for RSpec/Rails/HttpStatus Sep 21, 2023
@ydah ydah requested a review from pirj September 21, 2023 16:47
@ydah ydah force-pushed the fix-incorrect-autocorrect-httpstatus branch from 6deb770 to 488ab00 Compare September 22, 2023 07:43
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thank you!

@ydah ydah force-pushed the fix-incorrect-autocorrect-httpstatus branch from 488ab00 to 61213e4 Compare September 25, 2023 01:24
…RSpec/Rails/HttpStatus`

reproduction code
```rb
it { is_expected.to have_http_status '200' }
it { is_expected.to have_http_status "%[200]" }
it { is_expected.to have_http_status <<~HTTP }
  200
HTTP
```

expected
```rb
it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status :ok }
it { is_expected.to have_http_status <<~HTTP } # not offense
  200
HTTP
```

actual
```rb
it { is_expected.to have_http_status }
it { is_expected.to have_http_status }
it { is_expected.to have_http_status }
  200
HTTP
```
@ydah ydah force-pushed the fix-incorrect-autocorrect-httpstatus branch from 61213e4 to 5394ada Compare September 25, 2023 01:24
@bquorning bquorning merged commit 7b930a0 into master Sep 25, 2023
22 checks passed
@bquorning bquorning deleted the fix-incorrect-autocorrect-httpstatus branch September 25, 2023 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants