mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Adds around block with time.freeze
This commit is contained in:
@@ -6,6 +6,13 @@ describe "Packing Reports" do
|
||||
include AuthenticationHelper
|
||||
include WebHelper
|
||||
|
||||
around do |example|
|
||||
Timecop.freeze(Time.zone.now.strftime("%Y-%m-%d 00:00")) { example.run }
|
||||
end
|
||||
|
||||
let!(:open_datetime) { (Time.zone.now - 1.month).strftime("%Y-%m-%d 00:00") }
|
||||
let!(:close_datetime) { Time.zone.now.strftime("%Y-%m-%d 00:00") }
|
||||
|
||||
describe "Packing reports" do
|
||||
before do
|
||||
login_as_admin
|
||||
@@ -32,9 +39,6 @@ describe "Packing Reports" do
|
||||
let(:variant2) { create(:variant, product: product1, unit_description: "Small") }
|
||||
let(:product2) { create(:simple_product, name: "Product 2", supplier: supplier) }
|
||||
|
||||
let(:open_datetime) { (Time.zone.now - 1.month).strftime("%Y-%m-%d 00:00") }
|
||||
let(:close_datetime) { Time.zone.now.strftime("%Y-%m-%d 00:00") }
|
||||
|
||||
before do
|
||||
order1.finalize!
|
||||
order2.finalize!
|
||||
@@ -115,9 +119,6 @@ describe "Packing Reports" do
|
||||
let(:li1) { build(:line_item_with_shipment) }
|
||||
let(:li2) { build(:line_item_with_shipment) }
|
||||
|
||||
let(:open_datetime) { (Time.zone.now - 1.month).strftime("%Y-%m-%d 00:00") }
|
||||
let(:close_datetime) { Time.zone.now.strftime("%Y-%m-%d 00:00") }
|
||||
|
||||
before do
|
||||
order.line_items << li1
|
||||
order.line_items << li2
|
||||
|
||||
Reference in New Issue
Block a user