Browse Source

CLDC-4074: Update other sales log tests to use the current year instead of a fixed one

CLDC-4074-update-tests
Samuel Young 2 weeks ago
parent
commit
e810f960ae
  1. 9
      spec/features/sales_log_spec.rb

9
spec/features/sales_log_spec.rb

@ -1,6 +1,8 @@
require "rails_helper"
RSpec.describe "Sales Log Features" do
include CollectionTimeHelper
context "when searching for specific sales logs" do
context "when I am signed in and there are sales logs in the database" do
let(:user) { FactoryBot.create(:user, last_sign_in_at: Time.zone.now, name: "Jimbo") }
@ -234,6 +236,7 @@ RSpec.describe "Sales Log Features" do
context "when I am signed in" do
let(:user) { create(:user, last_sign_in_at: Time.zone.now) }
let(:current_date) { current_collection_start_date }
before do
create(:sales_log, :in_progress, owning_organisation: user.organisation, assigned_to: user)
@ -243,7 +246,7 @@ RSpec.describe "Sales Log Features" do
end
context "when viewing pages within a log" do
let(:sales_log) { FactoryBot.create(:sales_log, :shared_ownership_setup_complete, jointpur: 2, owning_organisation: user.organisation, assigned_to: user, saledate: Time.zone.local(2024, 12, 3)) }
let(:sales_log) { FactoryBot.create(:sales_log, :shared_ownership_setup_complete, jointpur: 2, owning_organisation: user.organisation, assigned_to: user, saledate: current_date) }
context "when visiting the address page" do
before do
@ -251,7 +254,7 @@ RSpec.describe "Sales Log Features" do
end
it "displays the question number in the page header" do
expect(page).to have_content("Q16")
expect(page).to have_content("Q14")
end
end
@ -261,7 +264,7 @@ RSpec.describe "Sales Log Features" do
end
it "has the expected content" do
expect(page).to have_content(/Shared ownership scheme\s*About the staircasing transaction/)
expect(page).to have_content(/Shared ownership - staircasing transaction\s*About the staircasing transaction/)
end
end
end

Loading…
Cancel
Save