12346 - fix rubocop rails/pluck errors

This commit is contained in:
Ahmed Ejaz
2024-06-22 01:45:58 +05:00
parent 0dd7f264b9
commit 98e0b0e703
17 changed files with 38 additions and 64 deletions

View File

@@ -69,7 +69,7 @@ RSpec.describe Admin::SubscriptionsController, type: :controller do
get(:index, params:)
json_response = JSON.parse(response.body)
expect(json_response.count).to be 2
expect(json_response.map{ |so| so['id'] }).to include subscription.id, subscription2.id
expect(json_response.pluck(:id)).to include subscription.id, subscription2.id
end
context "when ransack predicates are submitted" do
@@ -79,7 +79,7 @@ RSpec.describe Admin::SubscriptionsController, type: :controller do
get(:index, params:)
json_response = JSON.parse(response.body)
expect(json_response.count).to be 1
ids = json_response.map{ |so| so['id'] }
ids = json_response.pluck(:id)
expect(ids).to include subscription2.id
expect(ids).not_to include subscription.id
end