Add and apply Rails/ResponseParsedBody rubocop rule

This rule was introduced in rubocop-rails 2.18.0.

Since using `response.parsed_body` is shorter than using
`JSON.parse(response.body)`, this also means we can group some lines in
one.
This commit is contained in:
Javi Martín
2023-09-06 15:13:20 +02:00
parent cb32d19f5e
commit 2951d0fdf8
4 changed files with 13 additions and 16 deletions

View File

@@ -22,8 +22,8 @@ describe InstallationController, type: :request do
get "/consul.json"
expect(response).to have_http_status(:ok)
expect(JSON.parse(response.body)["release"]).not_to be_empty
expect(JSON.parse(response.body)["features"]).to eq(test_process_settings)
expect(response.parsed_body["release"]).not_to be_empty
expect(response.parsed_body["features"]).to eq(test_process_settings)
end
end
end