|
|
@ -1,6 +1,8 @@ |
|
|
|
require "rails_helper" |
|
|
|
require "rails_helper" |
|
|
|
|
|
|
|
|
|
|
|
RSpec.describe "Sales Log Features" do |
|
|
|
RSpec.describe "Sales Log Features" do |
|
|
|
|
|
|
|
include CollectionTimeHelper |
|
|
|
|
|
|
|
|
|
|
|
context "when searching for specific sales logs" do |
|
|
|
context "when searching for specific sales logs" do |
|
|
|
context "when I am signed in and there are sales logs in the database" 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") } |
|
|
|
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 |
|
|
|
context "when I am signed in" do |
|
|
|
let(:user) { create(:user, last_sign_in_at: Time.zone.now) } |
|
|
|
let(:user) { create(:user, last_sign_in_at: Time.zone.now) } |
|
|
|
|
|
|
|
let(:current_date) { current_collection_start_date } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
create(:sales_log, :in_progress, owning_organisation: user.organisation, assigned_to: user) |
|
|
|
create(:sales_log, :in_progress, owning_organisation: user.organisation, assigned_to: user) |
|
|
@ -243,7 +246,7 @@ RSpec.describe "Sales Log Features" do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when viewing pages within a log" do |
|
|
|
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 |
|
|
|
context "when visiting the address page" do |
|
|
|
before do |
|
|
|
before do |
|
|
@ -251,7 +254,7 @@ RSpec.describe "Sales Log Features" do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "displays the question number in the page header" do |
|
|
|
it "displays the question number in the page header" do |
|
|
|
expect(page).to have_content("Q16") |
|
|
|
expect(page).to have_content("Q14") |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -261,7 +264,7 @@ RSpec.describe "Sales Log Features" do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "has the expected content" do |
|
|
|
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 |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|