|
|
@ -91,6 +91,15 @@ RSpec.describe SalesLog, type: :model do |
|
|
|
let(:sales_log) { build(:sales_log, created_by: created_by_user) } |
|
|
|
let(:sales_log) { build(:sales_log, created_by: created_by_user) } |
|
|
|
let(:sales_log_2) { build(:sales_log, saledate: Time.zone.local(2022, 5, 1), created_by: created_by_user) } |
|
|
|
let(:sales_log_2) { build(:sales_log, saledate: Time.zone.local(2022, 5, 1), created_by: created_by_user) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
Timecop.freeze(Time.zone.local(2023, 1, 10)) |
|
|
|
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
after do |
|
|
|
|
|
|
|
Timecop.return |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "has returns the correct form based on the start date" do |
|
|
|
it "has returns the correct form based on the start date" do |
|
|
|
expect(sales_log.form_name).to be_nil |
|
|
|
expect(sales_log.form_name).to be_nil |
|
|
|
expect(sales_log.form).to be_a(Form) |
|
|
|
expect(sales_log.form).to be_a(Form) |
|
|
|