Skip to content

Commit

Permalink
Merge pull request #3034 from projectblacklight/rubocop-update
Browse files Browse the repository at this point in the history
Autocorrect new rubocop rules
  • Loading branch information
jcoyne committed Mar 16, 2023
2 parents 9e51700 + 463863f commit d4ee646
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@

format = facets.find { |x| x['id'] == 'format' }

expect(format['attributes']['items'].pluck('attributes')).to match_array([{ "value" => "Book", "hits" => 30, "label" => "Book" }])
expect(format['attributes']['items'].pluck('attributes')).to contain_exactly({ "value" => "Book", "hits" => 30, "label" => "Book" })
expect(format['links']['self']).to eq facet_catalog_url(format: :json, id: 'format')
expect(format['attributes']['items'].first['links']['self']).to eq search_catalog_url(format: :json, f: { format: ['Book'] })
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/blacklight/open_struct_with_hash_access_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

it "sorts the underlying hash" do
sorted = subject.sort_by { |_k, v| v }
expect(sorted.keys).to match_array [:b, :a, :c]
expect(sorted.keys).to contain_exactly(:b, :a, :c)
end
end

Expand All @@ -85,7 +85,7 @@

it "sorts the underlying hash" do
subject.sort_by! { |_k, v| v }
expect(subject.keys).to match_array [:b, :a, :c]
expect(subject.keys).to contain_exactly(:b, :a, :c)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/models/blacklight/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@

expect(config.a[:value]).to eq 1
expect(config_copy.a[:value]).to eq 2
expect(config.b).to match_array [1, 2, 3]
expect(config_copy.b).to match_array [1, 2, 3, 5]
expect(config.b).to contain_exactly(1, 2, 3)
expect(config_copy.b).to contain_exactly(1, 2, 3, 5)
expect(config.c.value).to match_array %w[a b]
expect(config_copy.c.value).to match_array %w[a b c]
end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/blacklight/search_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

it "is mutable" do
subject.processor_chain.insert(-1, :d)
expect(subject.processor_chain).to match_array [:a, :b, :c, :d]
expect(subject.processor_chain).to contain_exactly(:a, :b, :c, :d)
end
end

Expand All @@ -56,7 +56,7 @@
builder = subject.append(:d, :e)
expect(subject.processor_chain).to eq processor_chain
expect(builder.processor_chain).not_to eq subject.processor_chain
expect(builder.processor_chain).to match_array [:a, :b, :c, :d, :e]
expect(builder.processor_chain).to contain_exactly(:a, :b, :c, :d, :e)
end
end

Expand All @@ -68,7 +68,7 @@
expect(builder).not_to equal(subject)
expect(subject.processor_chain).to eq processor_chain
expect(builder.processor_chain).not_to eq subject.processor_chain
expect(builder.processor_chain).to match_array [:a, :c, :e]
expect(builder.processor_chain).to contain_exactly(:a, :c, :e)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/models/blacklight/solr/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
subject.append_query 'this is my query'
subject.append_query 'another:query'
expect(subject).not_to have_key 'q'
expect(subject.dig('json', 'query', 'bool', 'must')).to match_array ['this is my query', 'another:query']
expect(subject.dig('json', 'query', 'bool', 'must')).to contain_exactly('this is my query', 'another:query')
end
end

Expand All @@ -62,7 +62,7 @@
subject['q'] = 'some query'
subject.append_boolean_query :must, 'also required'

expect(subject.dig('json', 'query', 'bool', 'must')).to match_array ['some query', 'also required']
expect(subject.dig('json', 'query', 'bool', 'must')).to contain_exactly('some query', 'also required')
end
end
end
2 changes: 1 addition & 1 deletion spec/support/view_component_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def controller
return super if defined?(super)

# ViewComponent 3.x
return __vc_test_helpers_controller if defined?(__vc_test_helpers_controller)
return vc_test_controller if defined?(vc_test_controller)

ApplicationController.new.extend(Rails.application.routes.url_helpers)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/views/catalog/index.json.jbuilder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
expect(facets.pluck('id')).to include 'format'
expect(format['links']).to include self: 'http://test.host/some/facet/url'
expect(format['attributes']['label']).to eq 'Format'
expect(format_item_attributes).to match_array [{ value: 'Book', hits: 30, label: 'Book' }]
expect(format_item_attributes).to contain_exactly({ value: 'Book', hits: 30, label: 'Book' })
end
end

Expand Down

0 comments on commit d4ee646

Please sign in to comment.