mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
12346 - fix broken specs
This commit is contained in:
@@ -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.pluck(: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.pluck(:id)
|
||||
ids = json_response.pluck('id')
|
||||
expect(ids).to include subscription2.id
|
||||
expect(ids).not_to include subscription.id
|
||||
end
|
||||
|
||||
@@ -146,8 +146,8 @@ module Api
|
||||
as: :json
|
||||
|
||||
expect(json_response['orders']
|
||||
.pluck(:id)).to eq serialized_orders([order2, order3, order1, order4])
|
||||
.pluck(:id)
|
||||
.pluck('id')).to eq serialized_orders([order2, order3, order1, order4])
|
||||
.pluck('id')
|
||||
end
|
||||
|
||||
context "with an order without billing address" do
|
||||
@@ -161,17 +161,17 @@ module Api
|
||||
as: :json
|
||||
|
||||
expect(json_response['orders']
|
||||
.pluck(:id)).to match_array serialized_orders([order2, order3, order1, order4,
|
||||
order7])
|
||||
.pluck(:id)
|
||||
.pluck('id')).to match_array serialized_orders([order2, order3, order1, order4,
|
||||
order7])
|
||||
.pluck('id')
|
||||
end
|
||||
|
||||
it 'can sort orders by bill_address.lastname' do
|
||||
get :index, params: { q: { s: 'bill_address_lastname ASC' } },
|
||||
as: :json
|
||||
expect(json_response['orders']
|
||||
.pluck(:id)).to eq serialized_orders([order2, order3, order1, order4, order7])
|
||||
.pluck(:id)
|
||||
.pluck('id')).to eq serialized_orders([order2, order3, order1, order4, order7])
|
||||
.pluck('id')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,7 +41,7 @@ RSpec.describe Api::Admin::ForOrderCycle::SuppliedProductSerializer do
|
||||
describe "supplied products" do
|
||||
it "renders variants regardless of whether they are in the coordinators inventory" do
|
||||
expect(serialized_product).to have_json_size(2).at_path 'variants'
|
||||
variant_ids = parse_json(serialized_product)['variants'].pluck(:id)
|
||||
variant_ids = parse_json(serialized_product)['variants'].pluck('id')
|
||||
expect(variant_ids).to include non_inventory_variant.id, inventory_variant.id
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user