mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Fix Style/HashSyntax
This commit is contained in:
@@ -9,9 +9,9 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
let!(:user) { create(:user, enterprise_limit: 10) }
|
||||
let!(:shop) { create(:distributor_enterprise) }
|
||||
let!(:order_cycle) { create(:simple_order_cycle, orders_close_at: 1.day.from_now) }
|
||||
let!(:subscription) { create(:subscription, shop: shop, with_items: true) }
|
||||
let!(:subscription) { create(:subscription, shop:, with_items: true) }
|
||||
let!(:proxy_order) {
|
||||
create(:proxy_order, subscription: subscription, order_cycle: order_cycle)
|
||||
create(:proxy_order, subscription:, order_cycle:)
|
||||
}
|
||||
|
||||
before do
|
||||
@@ -44,7 +44,7 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
|
||||
context "when cancellation succeeds" do
|
||||
it 'renders the cancelled proxy_order as json' do
|
||||
get :cancel, params: params
|
||||
get(:cancel, params:)
|
||||
json_response = JSON.parse(response.body)
|
||||
expect(json_response['state']).to eq "canceled"
|
||||
expect(json_response['id']).to eq proxy_order.id
|
||||
@@ -56,7 +56,7 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
before { order_cycle.update(orders_close_at: 1.day.ago) }
|
||||
|
||||
it "shows an error" do
|
||||
get :cancel, params: params
|
||||
get(:cancel, params:)
|
||||
json_response = JSON.parse(response.body)
|
||||
expect(json_response['errors']).to eq ['Could not cancel the order']
|
||||
end
|
||||
@@ -73,10 +73,10 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
let!(:payment_method) { create(:payment_method) }
|
||||
let!(:shipping_method) { create(:shipping_method) }
|
||||
let!(:subscription) do
|
||||
create(:subscription, shipping_method: shipping_method, shop: shop, with_items: true)
|
||||
create(:subscription, shipping_method:, shop:, with_items: true)
|
||||
end
|
||||
let!(:proxy_order) {
|
||||
create(:proxy_order, subscription: subscription, order_cycle: order_cycle)
|
||||
create(:proxy_order, subscription:, order_cycle:)
|
||||
}
|
||||
let(:order) { proxy_order.initialise_order! }
|
||||
|
||||
@@ -115,7 +115,7 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
|
||||
context "when resuming succeeds" do
|
||||
it 'renders the resumed proxy_order as json' do
|
||||
get :resume, params: params
|
||||
get(:resume, params:)
|
||||
json_response = JSON.parse(response.body)
|
||||
expect(json_response['state']).to eq "resumed"
|
||||
expect(json_response['id']).to eq proxy_order.id
|
||||
@@ -127,7 +127,7 @@ describe Admin::ProxyOrdersController, type: :controller do
|
||||
before { order_cycle.update(orders_close_at: 1.day.ago) }
|
||||
|
||||
it "shows an error" do
|
||||
get :resume, params: params
|
||||
get(:resume, params:)
|
||||
json_response = JSON.parse(response.body)
|
||||
expect(json_response['errors']).to eq ['Could not resume the order']
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user