Enable Rubocop RSpec/ExpectActual (#23720)

This commit is contained in:
Nick Schonning 2023-02-19 23:00:59 -05:00 committed by GitHub
parent 38a1d8bb85
commit 4ea1e0fceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View file

@ -821,12 +821,6 @@ RSpec/EmptyExampleGroup:
RSpec/ExampleLength: RSpec/ExampleLength:
Max: 22 Max: 22
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExpectActual:
Exclude:
- 'spec/controllers/well_known/nodeinfo_controller_spec.rb'
# Offense count: 21 # Offense count: 21
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.

View file

@ -26,8 +26,9 @@ describe WellKnown::NodeInfoController, type: :controller do
expect(response.media_type).to eq 'application/json' expect(response.media_type).to eq 'application/json'
json = body_as_json json = body_as_json
foo = { 'foo' => 0 }
expect({ 'foo' => 0 }).to_not match_json_schema('nodeinfo_2.0') expect(foo).to_not match_json_schema('nodeinfo_2.0')
expect(json).to match_json_schema('nodeinfo_2.0') expect(json).to match_json_schema('nodeinfo_2.0')
expect(json[:version]).to eq '2.0' expect(json[:version]).to eq '2.0'
expect(json[:usage]).to be_a Hash expect(json[:usage]).to be_a Hash